patchlwIP - A Lightweight TCP/IP stack - Patches: patch #9520, httpd: add a gawk version of...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #9520: httpd: add a gawk version of makefsdata

Submitted by:  Mike Kleshov <kleshov>
Submitted on:  Mon 18 Dec 2017 08:25:42 PM UTC  
 
Category:  apps Priority:  3 - Low
Status:  Wont Do Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Planned Release:  None

Sat 06 Jan 2018 07:54:33 PM UTC, comment #4:

> keep httpd simple


I'm OK with that.

> Say, gzip is easy to add: just compress the file and add a proper HTTP header.


Well, in this case it is encapsulated in makefsdata. You could gzip it outside, but then you would have to find a way to tell makefsdata that a files is gziped to include the correct header.

> a flat directory of files in server root is good enough for most people


That's your opinion. Ask any web page designer I worked with and they will say no ;-)

Simon Goldschmidt <goldsimon>
Project Administrator
Sat 06 Jan 2018 06:32:31 PM UTC, comment #3:

I guess what I'm trying to say is this: keep httpd simple. If some functionality requires only a minor modification from the user, let him do it. Say, gzip is easy to add: just compress the file and add a proper HTTP header. Another example is fs directory structure: a flat directory of files in server root is good enough for most people.

Mike Kleshov <kleshov>
Project Member
Sat 06 Jan 2018 03:56:32 PM UTC, comment #2:

I agree, adding this to git would probably be too much. The thing is, this bare-bones Awk script is simple enough to expand even for someone not familiar with Awk. I just don't know what would be a good place for something like this.
"the C compiler will be available when compiling a C project" is not a valid argument. A cross compiler and a native compiler are different things. On Windows, you'd have to install MinGW or something else. Why not install Perl of Gawk instead? By the way, embedding gzip compression into C source is questionable. Calling gzip or even zopfli as an external program would be better, IMO.
Anyway, I got the impression that a user of lwip httpd would have to know his way around the code, so a script to make fs data would be easy for him to put together.

Mike Kleshov <kleshov>
Project Member
Sat 06 Jan 2018 01:32:00 PM UTC, comment #1:

If this got added to git, who would maintain it if someone makes changes to httpd or makefsdata in the future? lwIP is a C project. That's why even the perl version of 'makefsdata' is outdated.

I'm afraid I don't see a real use for 2 or more programs in diferent languages to create the fs. I'd rather even delete the perl thing.

> I find the .c version of makefsdata unnecessary and bloated


Well, in that case you might help to fix it :-)
I know C is not the best language for this kind of text & byte manipulation. But the C compiler will be available when compiling a C project.

> Perl requires a proper installation on Windows, whereas gawk does not.


You still need to install an interpreter some way. Whether through an installer or install-by-copy.

Simon Goldschmidt <goldsimon>
Project Administrator
Mon 18 Dec 2017 08:25:42 PM UTC, original submission:

I find gawk very useful for my makefiles. One example is a simple bin2c, the other is parsing bitmaps and converting them to C arrays in an appropriate format. gawk is readily available not only for unixes but also for Windows (it's just a single .exe file, see GnuWin32.)
I am attaching a basic version of makefsdata.awk that I used when evaluating lwip httpd. I find the .c version of makefsdata unnecessary and bloated. For the other version, Perl requires a proper installation on Windows, whereas gawk does not.
Also, I'd like to take this opportunity to thank Simon for great work on httpd. It is simple, yet provides enough features to make rich web interfaces.

Mike Kleshov <kleshov>
Project Member

 

Attached Files
file #42676:  makefsdata.awk added by kleshov (2KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by kleshov (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-01-07 kleshov StatusNone => Wont Do
        Open/ClosedOpen => Closed
    2017-12-18 kleshov Attached File- => Added makefsdata.awk, #42676

    Back to the top


    Powered by Savane 3.4