Code Monkey home page Code Monkey logo

mongoose's People

Watchers

 avatar

mongoose's Issues

mg_get_var truncates posted variables

What steps will reproduce the problem?
1. Post a large amount of data into one variable (greater than 1KB)
2. Read the posted data using mg_get_var

What is the expected output? What do you see instead?
You should have the entire posted variable returned from mg_get_var.
instead it truncates the data to BUFSIZ (1024 bytes on my machine)

What version of the product are you using? On what operating system?
mongoose 2.3 embedded in an application on OSX 10.5.6

I can get around this by reading the raw post_data in request_info, but
mg_get_var shouldn't truncate, or at lest the documentation should be
updated to say that it does.



Original issue reported on code.google.com by [email protected] on 15 Jan 2009 at 11:53

index.cgi is not treated as cgi file

What steps will reproduce the problem?
1. Create a default page index.cgi in the current mongoose directory with
the content.

#!c:\strawberry\perl\bin\perl
use CGI;
my $cgi = new CGI;
print $cgi->header();
print "Hello World\n";

2. Call the page in the browser without mentioning index.cgi(for eg
http://localhost:8080/). since index.cgi is the default page index.cgi file
should be executed and the output should be printed on the screen.

3. Do not create other default pages like index.html or index.htm

What is the expected output? What do you see instead?
 "Hello world" should be printed on the screen. But it prints the content
of the file as it is. Instead of treating index.cgi as cgi file it treats
it as a text file. 

What version of the product are you using? On what operating system?
 2.3 on windows

Please provide any additional information below.
  Mongoose is not treating index.cgi as a cgi file when it is the default page.

  But works as expected when we call explicitly mentioning index.cgi in the
browser like http://localhost:8080/index.cgi

Original issue reported on code.google.com by [email protected] on 14 Apr 2009 at 12:44

Provide MIME type mapping to application through library API interface

This is indeed a feature request. 

Application who serves dynamic web pages needs to map from file extension
to mime type and specify it in response header. Currently the MIME type
information is managed inside the library but not exported through API
interface.

What is the expected output? What do you see instead?
Given a file extension, e.g. jpg, png, a library API function returns the
MIME type if it is found or NULL if not found.

What version of the product are you using? On what operating system?
2.4, Windows and Linux.

Please provide any additional information below.
"Mongoose can export function get_mime_type()."

Original issue reported on code.google.com by [email protected] on 10 Apr 2009 at 7:25

mongoose dying from SIGPIPE

The call to 'send' in the 'push' function should pass the MSG_NOSIGNAL flag 
to send, else it is possible to get a SIGPIPE which kills the application.

Patch:

@@ -1027,7 +1030,7 @@
                } else if (fd != -1) {
                        n = write(fd, buf + sent, k);
                } else {
-                       n = send(sock, buf + sent, k, 0);
+                       n = send(sock, buf + sent, k, MSG_NOSIGNAL);
                }

                if (n < 0)


Original issue reported on code.google.com by [email protected] on 5 Mar 2009 at 7:22

Windows DLL

Adding Microsoft's __declspec(dllexport) or __declspec(dllimport) helps to
create a Windows DLL of the Mongoose library.

While not required, this eliminates the need to list the exports in a
separate file.

Original issue reported on code.google.com by [email protected] on 21 May 2009 at 5:16

Attachments:

Mongoose standalone seems to start slowly

What steps will reproduce the problem?
1. Run mongoose-2.6.exe on Windows XP Home SP3
2. Notice how there is a long delay between the aappearance of the command
window and Mongoose being up.

Please provide any additional information below.

I routinely run Apache, and it seems to start up sightly faster in spite of
its complexity. Also, I used to run PWS (personal IIS), and it started up
almost instantly.

Original issue reported on code.google.com by [email protected] on 21 May 2009 at 1:52

sort order in dir listing

What steps will reproduce the problem?
1. Look at a directory listing

What is the expected output? What do you see instead?
Files have a random sort order, but I'd expect something like an
alphabetical sort order. At the moment it is really hard to find the right
files in longer listings and it just looks awful :-)

What version of the product are you using? On what operating system?
Version 2.3 on Zenwalk Linux (glibc 2.7, kernel 2.6.28.2)


Original issue reported on code.google.com by [email protected] on 4 Feb 2009 at 9:49

Files bugger than 4 gb not supported

What steps will reproduce the problem?
1. create a file bigger than 4 gigabytes
2. try to download it
3. the size reported will be the actual size minus 4 gigabytes

What is the expected output? What do you see instead?
Read step 3

What version of the product are you using? On what operating system?
2.3 windows xp ntfs filesystem

Please provide any additional information below.
You are using 32 bit sized variables that are not enough for more than 2^32
bytes

Original issue reported on code.google.com by [email protected] on 24 Feb 2009 at 6:49

mime_types not a recognized option

What steps will reproduce the problem?
1. -mime_types on the command line
2. mime_types in the config file


What version of the product are you using? On what operating system?
2.3 on Windows

C:\Program Files\mongoose-2.3>mongoose
Loading config file mongoose.conf
No such option: "mime_types"


Original issue reported on code.google.com by [email protected] on 16 Jan 2009 at 6:07

Handle Expect: 100-continue

This does not imply chunked transfer encoding support.
Merely reaply with 100, if client wants it.

Original issue reported on code.google.com by valenok on 3 Dec 2008 at 1:10

Static Lib

Isn't it possible to have some static libs under Windows (.lib) and Linux
(.a) for making a new binding ?

Original issue reported on code.google.com by [email protected] on 7 May 2009 at 11:41

"Content-Range" has wrong entity length

What steps will reproduce the problem?
1. Initialize file downloading from mongoose;
2. Stop the downloading before it finished;
3. Restart the downloading;
4. The Content-Range has the left length of the downloading file as entity
length.

What is the expected output? What do you see instead?
Content-Range should has an entity length filled as the file total length.

What version of the product are you using? On what operating system?
2.5, Windows XP SP3

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 10 Apr 2009 at 2:52

Request for binary output command

Currently to output binary you need to do a work around using the following
code:
[code]
void show_data_Image( struct shttpd_arg *arg )
{
    #pragma warning(disable:4311)
    #pragma warning(disable:4312)

...

    int state = (int)arg->state;
    shttpd_printf( arg,
        "HTTP/1.1 200 OK\r\n"
        "Server: SlingIt\r\n"
        "Content-Type: image/jpeg\r\n"
        "Content-Length: %d\r\n"
        "\r\n",
        iContentLength
    );

    char b;
    int iPos = 0;
    while( arg->out.num_bytes < arg->out.len && sImageInfo.iFileSize > iPos )
    {
        b = cImage[ iPos ];
        iPos++;
        arg->out.buf[arg->out.num_bytes] = b;
        arg->out.num_bytes++;
        state++;
    }
    delete [] &b;
    arg->flags |= SHTTPD_END_OF_OUTPUT;
    arg->state = (void*)state;
}
    #pragma warning(default:4311)
    #pragma warning(default:4312)
}
[/code]
Is it possible for their to be a function added so that  binary data can be
output correctly.


What version of the product are you using? On what operating system?
Version:  SHTTPD - Ver. 1.18, Rev. 42
OS:  Any

Original issue reported on code.google.com by [email protected] on 10 Dec 2008 at 8:21

bound URIs have no access to PUT request data

when a PUT request is handed off to a bound URI handler, the request data
is not included.  The following change rectifies the situation:

static void
analyze_request(struct mg_connection *conn)
{
...
    if ((cb = find_callback(conn->ctx, FALSE, uri, -1)) != NULL) {
        if (!strcmp(ri->request_method, "POST") || !strcmp(ri->request_method,
"PUT"))
            handle_request_body(conn, -1);

        cb->func(conn, &conn->request_info, cb->user_data);
    } else

Original issue reported on code.google.com by [email protected] on 11 May 2009 at 8:39

Feature req: 404 page

Might seems like a silly request, but would it be possible to implement a 
directive that specifies a file to serve instead of the current 
"Error xxx: mmmm\ntttttt" error message for some of the error codes for 
which it makes sense (eg: 404, 403, 401, 500, 503, etc)?

What version of the product are you using? On what operating system?
  mongoose-2.6 on WinXP MCE 2k2

Original issue reported on code.google.com by [email protected] on 22 May 2009 at 7:27

Mongoose crashes when no Accept header is specified

What steps will reproduce the problem?

1. Do the following request:
"POST /someurl/ HTTP/1.1
Host: somehost.com
Content-Type: text/plain
Content-Length: 15

parameter=value"

2. Mongoose crashes with the message:
"Unhandled exception at 0x70d8b690 in Some.exe: 0xC0000005: Access violation 
reading 
location 0x00000000."

3. Do the following request:
"POST /someuri HTTP/1.1
Host: somehost.com
Accept: text/html
Content-Type: text/plain
Content-Length: 15

parameter=value"

4. Mongoose does not crash.

What is the expected output? What do you see instead?

Mongoose should not crash.

What version of the product are you using? On what operating system?
Mongoose version 2.4, Windows Vista

Greetings.

Original issue reported on code.google.com by [email protected] on 29 Apr 2009 at 12:42

Bind to port implemented, but no bind to IP?

I see that the program has a bind-to-specific-port(s) option on the 
command line and via the config file. I don't see that there's a way to 
bind to a specific IP address. 

I've got a machine I'd like to have a "production quality" HTTP server as 
well as this lighter HTTP server. For reasons I don't want to go into, 
both NEED to be on port 80, I can only vary the IP address, not the port. 

It'd be nice if I could do that by having bind-to-ip functionality in 
mongoose, too.

What version of the product are you using? On what operating system?
  mongoose-2.6 for Windows, via installer (not that it matters)
  Windows XP MCE 2002 SP3

Original issue reported on code.google.com by [email protected] on 22 May 2009 at 7:10

Enhancement: Threading Model

IMHO the simple threading model used by Mongoose is not great for 
performance.  Better would be to keep spawned threads around after 
connection closure waiting for another connection, exiting only after some 
configurable idle time.

Another requirement for this, which I believe should be implemented anyway, 
is not to detach threads but keep track of them and properly "pthread_join" 
each of them at the time of mg_stop.  This would prevent long-running 
requests from accessing context-level data that has been freed by the main 
thread.

Original issue reported on code.google.com by [email protected] on 5 Mar 2009 at 8:27

Persisten connection....

What steps will reproduce the problem?
1.  I have a script (cgi) that sends every 5 seconds a code to the browser to
     mantain the connection open
2.  Stracing the forked index.cgi i see that the child  sends every 5
seconds the
     code for testing the status of the opened window 
3.  The index.cgi itself creates the stream and outputs the stream but this
will not
     be sent over the net, only on stdout


The expected result is to see the client window busy due to the connection
from 
server.

instead of this i see only the window withouth having the @busy@ state

I use the latest code on a Debian system

My cgi works in this manner:

the clients authenticates against mongoose/index.cgi
if the authentication is ok the cgi goes into loop and every 5 seconds
it sends a packet to the client for ensuring it's alive.

Do you have a simple example on how to do this with mongoose?
If possible, of course!

Tx, Diaolin



Original issue reported on code.google.com by [email protected] on 12 Mar 2009 at 3:41

Crash on line 2630 mongoose.c

Code compiles but crashes.
Debug shows that the code crashes in:
Line: 2630
Function: set_ports_option()
Code: FOR_EACH_WORD_IN_LIST(p, len) {

Debug error message:
First-chance exception at 0x750e58cf in Mongoose.exe: 0xC0000005: Access
violation reading location 0x00000050.
Unhandled exception at 0x750e58cf in Mongoose.exe: 0xC0000005: Access
violation reading location 0x00000050.


What version of the product are you using? On what operating system?
Latest rev from svn.
Win Vista x64 Home Premium

Original issue reported on code.google.com by [email protected] on 12 Dec 2008 at 12:26

mg_get_var gets it wrong with uri escaped (%2b) characters

What steps will reproduce the problem?
1. uri handler with uri "/uri?q=plus%2bone&p=two"
2. mg_get_var(conn, "q") returns "plus+one&" (Note, incorrect trailing "&")
3. with "/uri?q=plus%2bone&p=plus%2btwo" mg_get_var(conn, "q") gives a crash

What is the expected output? What do you see instead?
get_var("q", "/uri?q=plus%2bone&p=two", ...)
should return "plus+one"

get_var("q", "/uri?q=plus%2bone&p=plus%2btwo", ...)
should not crash

What version of the product are you using? On what operating system?
2.4

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 11 Mar 2009 at 2:31

fix_directory_separators(char *path) destroys UNC ("\\networkpath\path\file.txt") paths

What steps will reproduce the problem?
1. fix_directory_separators("\\networkpath\path\file.txt") ==
"\networkpath\path\file.txt")  (Note lost "\")
2.
3.

What is the expected output? What do you see instead?
fix_directory_separators should preserve valid UNC paths, ie "\\" is valid
at begining of path.
fix_directory_separators("\\networkpath\path\file.txt") ==
"\\networkpath\path\file.txt"

What version of the product are you using? On what operating system?
mongoose 2.4 on Windows

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 11 Mar 2009 at 12:03

set_close_on_exec on opened files

no-op on Windows.
good practice, since we're spawning CGI processes

Original issue reported on code.google.com by valenok on 2 Dec 2008 at 3:47

Mongoose for WIndows CE

I found that Mongoose had some ifdef's for Windows CE, but would not
compile without major changes. I have made changes necessary to make it
compile and run on CE.  At this point some of the changes are better then
others.

Is it a goal to support the Windows CE environment?  If so, then the
attached patches may be useful.  If not, then please still look at the
patches because I think there may be similar problems with the standard
Win32 implementation.

Original issue reported on code.google.com by [email protected] on 21 May 2009 at 6:45

Attachments:

mutex-guard mg_* functions

A must have in threaded environment

Original issue reported on code.google.com by valenok on 2 Dec 2008 at 3:46

Source does not compile under cygwin

What steps will reproduce the problem?
1. Install Cygwin on windows xp.
2. run `make linux`


What is the expected output?
program compiles

What do you see instead?

mongoose.c: In function `mg_vsnprintf':
mongoose.c:425: warning: implicit declaration of function `vsnprintf'
mongoose.c: In function `spawn_process':
mongoose.c:922: warning: implicit declaration of function `fileno'
mongoose.c: In function `get_content_length':
mongoose.c:1053: warning: implicit declaration of function `strtoull'
mongoose.c:1053: warning: signed and unsigned type in conditional 
expression
mongoose.c: In function `do_ssi_exec':
mongoose.c:2725: warning: implicit declaration of function `popen'
mongoose.c:2725: warning: assignment makes pointer from integer without a 
cas
mongoose.c:2729: warning: implicit declaration of function `pclose'
mongoose.c: At top level:
mongoose.c:3034: error: parse error before "fd_set"
mongoose.c: In function `add_to_set':
mongoose.c:3036: warning: implicit declaration of function `FD_SET'
mongoose.c:3036: error: `fd' undeclared (first use in this function)
mongoose.c:3036: error: (Each undeclared identifier is reported only once
mongoose.c:3036: error: for each function it appears in.)
mongoose.c:3036: error: `set' undeclared (first use in this function)
mongoose.c:3037: error: `max_fd' undeclared (first use in this function)
mongoose.c: In function `event_loop':
mongoose.c:3557: error: `fd_set' undeclared (first use in this function)
mongoose.c:3557: error: parse error before "read_set"
mongoose.c:3562: warning: implicit declaration of function `FD_ZERO'
mongoose.c:3562: error: `read_set' undeclared (first use in this function)
mongoose.c:3572: warning: implicit declaration of function `select'
mongoose.c:3584: warning: implicit declaration of function `FD_ISSET'
make: *** [linux] Error 1

What version of the product are you using? On what operating system?
cygwin winxp sp3



Original issue reported on code.google.com by [email protected] on 17 Feb 2009 at 5:48

default value for document root is ignored

What steps will reproduce the problem?
1. set the default value for document root in 'known_options'
2. create a file 'index.html' with some text in your document root as 
specified in 1.
3. start mongoose and point your browser to http://hostname:portname/

What is the expected output? What do you see instead?
I expected to see the text in 'index.html'. But I got a directory dump of
the current working directory.


What version of the product are you using? On what operating system?
MONGOOSE_VERSION    "2.4"
OS Suse 11.0


Please provide any additional information below.
code change proposal (line 3633):
/* if document root is not set yet, set it to current working directory */
if (ctx->options[OPT_ROOT] == NULL) {
    ctx->options[OPT_ROOT] = getcwd(NULL, 0);
}


Greetings and Thanks for the cool web server!
Mario

Original issue reported on code.google.com by [email protected] on 22 Jan 2009 at 6:51

Add -bind_addr option

This option would allow to bind to any specific address, instead of INADDR_ANY.

Original issue reported on code.google.com by valenok on 10 Apr 2009 at 7:28

mg_free function needed to use mongoose as dll

What steps will reproduce the problem?
1. Link mongoose dynamically
2. Call ::mg_get_var to get buffer with var value
3. Call ::free to destroy this buffer after use

What is the expected output? What do you see instead?
I have a crash as mongoose dll and host application (could) use different 
CRT's.

What version of the product are you using? On what operating system?
The latest version. OS: WindowsXP

Please provide any additional information below.
It would nice to have mg_free function to be able to free such buffers 
from the dll context using its CRT

Original issue reported on code.google.com by [email protected] on 2 Apr 2009 at 6:49

Unknown Error caused "POST" method while using mg as a library(static linked)

What steps will reproduce the problem?
1. compile the following file named main.cpp with mg.h and mg.c
=================BEGIN====================
//-DNO_SSL compile on VC8.0 (winXP)
#include "mongoose.h"

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>

const char normal_header[] =
    "HTTP/1.1 200 OK\n"
    "Content-Type: text/html; charset=gb2312\n"
    "Server: crazyb0y's server\n"
    "Connection: close\n\n";
const char html_header[] = "<html><title>welcome</title><body>\n";
const char html_footer[] = "</body></html>\n";
static void index(struct mg_connection *conn, const struct mg_request_info
*ri, void *user_data) {
    mg_printf(conn, normal_header);
    mg_printf(conn, html_header);
    mg_printf(conn, "<form method=\"POST\" action=\"/index\">\n");
    mg_printf(conn, "<table><tr><td>user: </td><td><input type=text
name=handle size=10 style='font-family:monospace'></td></tr>\n");
    mg_printf(conn, "<tr><td>password</td><td><input type=password name=pass
size=10 style='font-family:monospace'></td></tr></table>\n");
    mg_printf(conn, "<input type=Submit value=\"login\" name=action>\n");
    mg_printf(conn, "</form>\n");
    mg_printf(conn, html_footer);
}

int main() {
    mg_context *ctx = mg_start();
    mg_set_option(ctx, "ports", "80");
    mg_set_option(ctx, "dir_list", "no");
    mg_bind_to_uri(ctx, "/", &index, NULL);
    mg_bind_to_uri(ctx, "/index", &index, NULL);
    printf("started\n");
    system("pause");
    mg_stop(ctx);
}
=================END====================
2. open http://localhost/ with a browser (tested on firefox 3.0.5 and IE
7.0 winXP)
3. type anything and click login

What is the expected output? What do you see instead?
the original page, same as previous
##Error 577: Internal Server Error
##Error handling body data

What version of the product are you using? On what operating system?
the lastest, WinXP

Please provide any additional information below.

I traced into the library, and find it's caused in line 2999

hope you could solve this problem as quick as possible, I removed several
lines and works now.

Original issue reported on code.google.com by [email protected] on 18 Dec 2008 at 12:41

DocBug: Missing info re: ACL's

Was working with ACLs and had a devil of a time getting them to work until 
I discovered the "trick". The code for mongoose searches for a match 
through the list of permissions and seems to pick the LAST one that 
matches. This was unexpected, as I'm used to the Cisco ordering, which is 
the reverse, using the FIRST that matches. 

The -0.0.0.0/0 ("deny any") needed to be up front, and the +'s ("permit"s) 
then follow it. In Cisco ACLs, the "deny any" is the last entry in the ACL.

Not asking for a change in the code, just a notation in the ACL entry of 
the documentation to call attention to the ordering.

What version of the product are you using? On what operating system?
 mongoose-2.6, documentation as of 2009-05-22 3:56am EST.

Original issue reported on code.google.com by [email protected] on 22 May 2009 at 8:03

Enhancement: Dynamic Port

It would be nice if it was possible to tell Mongoose to bind to a port 
dynamically (can be done with ports = 0) and then get the actual port which 
was bound back out from the server.

Alternately, being able to pass a listening socket created by the user to 
Mongoose for accept().

Original issue reported on code.google.com by [email protected] on 5 Mar 2009 at 8:23

send_file() uses localtime() but format specifies GMT

send_file() uses the format:
  const char *fmt = "%a, %d %b %Y %H:%M:%S GMT";

but then uses localtime() as the parameter to strftime():
  (void) strftime(date, sizeof(date), fmt, localtime(&curtime));
  (void) strftime(lm, sizeof(lm), fmt, localtime(&stp->mtime));

Wouldn't this create a time string that indicates that it is GMT, but is
instead local time.  Shouldn't localtime() be replaced by gmtime()?

Original issue reported on code.google.com by [email protected] on 20 May 2009 at 5:06

Migration from shttp_d puzzling

I have been using SHTTPD as an API in a Windows Visual C++ Project. I would
like to migrate to mongoose.Is this always possible? Are notes available
for guiding would-be migrants such as myself?

With SHTTPD callbacks are called repeatedly until the request and response
are finished. This was controlled by shttpd_arg.flags. It is not clear to
me how this is handled by mongoose. Is the callback called only once? Must
MAX_REQUEST_SIZE be large enough to hold the largest possible transmission? 

Thanks.


Original issue reported on code.google.com by [email protected] on 12 Feb 2009 at 8:09

If a download is cancelled and the connection terminated, the server keeps on trying to read and send the file.

What steps will reproduce the problem?
1. Run the mongoose server.
2. Download a file from the server using a client browser (I am using 
Internet Explorer version 7).
3. Cancel the download before it is completed.

What is the expected output? What do you see instead?
The server will keep on 'reading' and 'sending' the file. As I am using 
this server in an embedded system, and the final product will be running 
other heavy libraries/modules as well, conservation of resources is of 
utmost importance. Therefore, I believe that it is wise to cancel the 
download on the server side if the connection is lost or the file download 
is cancelled by the client. I am not exactly sure what the HTTP RFC says 
in this regard, but I believe changing this would definitely lighten the 
load on the server.

What version of the product are you using? On what operating system?
I am using Mongoose 2.5 on Windows XP Professional Service Pack 3 and on a 
TriMedia embedded system.

Please provide any additional information below.
To change the above mentioned behaviour, I used the following: In the push
() API, inside the while loop, if the return value 'n' is less than zero 
the push() function returns a value of '-1'. mg_write() returns the return 
value of push(). In send_opened_file_stream() I simply use this check:

        rval =  mg_write(conn, buf, n);
        if(rval == -1)
            break;

Again, this prevents the server from reading and sending a file on a 
closed connection (when the client cancels a download and the connection 
is terminated).

I hope this would be of use. If I am missing out something, please point 
it out. Thank you.

Kind regards,
Hasaan A. Raza
Software Engineer
Streaming Networks

Original issue reported on code.google.com by [email protected] on 15 May 2009 at 6:09

win32 port

Move GUI code to main.c.
Make sure all tests are working on Windows platform, too

Original issue reported on code.google.com by valenok on 2 Dec 2008 at 3:49

root directory path containing diacritical signs (on Windows) not found

What steps will reproduce the problem?
1. create directory c:\liška
2. copy mongoose.exe into it
3. run mongoose.exe
4. view localhost in a browser

What is the expected output? What do you see instead?
It should return directory listing for c:\liška but returns "Error 404: Not
Found" instead.

What version of the product are you using? On what operating system?
mongoose-2.4 on Windows XP (Media Center Edition, SP3)

Please provide any additional information below.
I run it as a console application using only mongoose.exe

Original issue reported on code.google.com by [email protected] on 19 Apr 2009 at 8:38

Fix SSL loading when Mongoose runs as service

What steps will reproduce the problem?
1. Install Mongoose
2. Go to https://127.0.0.1

What is the expected output? What do you see instead?
Content of disk C: must be shown, connection refused instead.

Please use labels and text to provide additional information.

Service runs with current directory of c:/windows/system32. SSL libs are
installed in c:/mongoose-XX, and are invisible for LoadLibrary calls.

Original issue reported on code.google.com by valenok on 22 May 2009 at 9:03

Patch for problem with VS2005 compiler/linker

What steps will reproduce the problem?
1. Try to compile mongoose with VS2005 compiler

What is the expected output? What do you see instead?
Linker complains about unresolved symbol _SignalObjectAndWait

What version of the product are you using? On what operating system?
- Mongoose 2.6 & SVN trunk
- VS2005 SP1

Please provide any additional information below.
The function SignalObjectAndWait requires the symbol _WIN32_WINNT to be
defined with a value >= 0x0400. The attached patch contains the required
change.

Original issue reported on code.google.com by [email protected] on 18 May 2009 at 8:45

Attachments:

How to spawn .exe with parameters w/o requiring php/perl using windows cmd interpreter

I am trying to come up with a mechanism which will allow me launch a 
windows executable and pass it paramters. While this is not unusual, and 
no problem via a CGI script, I have a constraint on a particular system 
where I can't install perl, php, python, or basically anything else.  
(Government site, they don't want anything to touch registry, no DLLs, 
basically I can use compiled mongoose binary + either a .VBS or .CMD script
(s) & shtml/html files. -- one of those controlled systems that just can't 
tolerate one of the standard cgi interpreters)

With that in mind, is there a mechanism I can use to pass parameters to a 
CGI program that just calls cmd to do the HTML encapsulation? 

---------------------------------------------
test.cmd CONTENTS (The %1 is input parameter)
#!c:\windows\system32\cmd.exe
@echo off
echo Content-Type: text/html
echo.

echo ^<HTML^><BODY^>
#below proves something came back
set 
# below is what I really want to do
#start MyProgram.exe %1
echo ^<BODY^>^<HTML^>


----------
mongoose.conf
cgi_ext bat,cmd,exe
cgi_interp c:\windows\system32\cmd.exe

===   INDEX.HTML ===
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 
Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD> <TITLE>Text submission</TITLE>
</HEAD><BODY><P>Please press submit</P>
<FORM ACTION="test.cmd" METHOD="POST">
<INPUT TYPE="TEXT" NAME="ParmList" VALUE="ParmValue">
<INPUT TYPE="SUBMIT" NAME="textsubmit" VALUE="Submit Text">
</FORM></BODY></HTML>

When I try combination above (also tried test.bat) .. firebug indicates 
that no POST attempt is taking place.  However, once I click the submit 
button, the windows task manager says another instance of cmd is now 
running.

This should be relatively straightforward, unless I am missing something 
obvious or there is a bug.   (Note, I am using latest CVS built as of the 
time of this posting)..


Original issue reported on code.google.com by [email protected] on 3 Apr 2009 at 3:51

Leaking mg_connection objects

What steps will reproduce the problem?
1. valgrind any mongoose instance
2. Send a few requests to it
3. Exit the server, look at the leaks

What is the expected output? What do you see instead?
Expect no leaks.  I see leaks.

What version of the product are you using? On what operating system?
2.5

Please provide any additional information below.
Add free(conn) to the bottom of close_connection

Original issue reported on code.google.com by [email protected] on 5 Mar 2009 at 7:20

Mongoose fails to compile with MinGW on Windows

What steps will reproduce the problem?
1. Check out SVN trunk
2. Run mingw32-make mingw in checkout directory

What is the expected output? What do you see instead?
Make output:
D:\Checkout\Mongoose>mingw32-make mingw
gcc -W -Wall -mthreads -Wl,--subsystem,console -DNDEBUG -Os -DHAVE_STDINT
mongoose.c -lws2_32 -shared -Wl,--out-implib=mongoose.lib -o _mongoose.dll
mongoose.c:111: error: conflicting types for 'pid_t'
C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/sys/types.h:75:
error:
 previous declaration of 'pid_t' was here
mongoose.c: In function `cry':
mongoose.c:397: warning: implicit declaration of function `_lock_file'
mongoose.c:413: warning: implicit declaration of function `_unlock_file'
mongoose.c: In function `mg_stat':
mongoose.c:822: error: storage size of 'st' isn't known
mongoose.c:827: warning: implicit declaration of function `_wstat64'
mongoose.c:822: warning: unused variable `st'
mongoose.c: In function `set_ports_option':
mongoose.c:3166: warning: comparison between signed and unsigned
mingw32-make: *** [mingw] Error 1

What version of the product are you using? On what operating system?
- OS WinXP SP3
- MinGW 3.4.5
- Mongoose v2.5 and SVN trunk

Please provide any additional information below.
- Tried with cmd.exe and MSYS, (expectedly) both report the same error

Original issue reported on code.google.com by [email protected] on 28 Apr 2009 at 11:29

pragma pack should be moved

The packing directive should be specified immediately before the shared
structures and should be restored after defining the structures.

#pragma pack(1)
struct mg_request_info {
 // ...removed for clarity...
};
#pragma pack()

Because the mg_request_info is the only shared public structure it should
be the only one that is packed (if the comment currently above the pack
directive is correct.)  Also, it looks as if it should not require packing
as all the items look to be 32bit in length and would pack nicely anyway.

*Please note that I am writing from the Windows point of view and cannot
speak for *nix.

Original issue reported on code.google.com by [email protected] on 21 May 2009 at 5:50

Bind to ip address other then INADDR_ANY

In a machine with many NICs/IPs we may need to select which local IP address 
to bind to. My sugestion is to add an option (bind_addr):
  mg_set_option(ctx, "bind_addr", "1.2.3.4")
It defaults to:
  sin_addr.s_addr = htonl(INADDR_ANY);
otherwise 
  sin_addr.s_addr = inet_addr("1.2.3.4");

Patch is trivial, let me know if you need one ... 

Best regards,
Rui

Original issue reported on code.google.com by [email protected] on 8 Apr 2009 at 3:51

Needs better documentation

I downloaded the Windows version and found only the executable, config
file, and uninstaller. The Google Code site doesn't even mention that
Mongoose is the successor to shttpd (which is only a little better
documented). There is nothing on Wikipedia.

These days, for software to be accepted, it must have complete and
user-friendly documentation. In fact, many experienced software engineers
(I am one) agree that good, up-to-date documentation is indispensable if
software is to be used by more than one person or is intended to have a
lifetime of more than a few days. Many modern engineers will not even look
at software that is poorly documented.

Mongoose (and shttpd before it) appear to be very useful, filling the vital
role of making almost any computer into a quick-and-limited Web server with
small resource usage. For this reason, Mongoose deserves good
documentation, so it can be used by anyone who needs it.

I realize that programmers outside of the USA may have a different culture,
one in which documentation is seen as obvious or unnecessary. Writing
working code is seen as all that matters. The USA was like that in the
1960's and before. However, we have learned about the importance of good
documentation to make software inviting and useful to everyone and so can you.

I urge you to give these thoughts some consideration, and to take time out
soon to focus on a really good user manual, one that requires a minimum of
previous experience with Web servers, SSL, etc. You will be rewarded by a
fast-growing user community who will praise your software and more
importantly, use it.

David Spector
Springtime Software

Original issue reported on code.google.com by [email protected] on 17 Dec 2008 at 2:36

example wiki typo

fairly unimportant, but:

in: http://code.google.com/p/mongoose/wiki/EmbeddingMongoose

static void bar(struct mg_connection *conn, struct mg_requst_info *ri, void
*data)
should be:
static void bar(struct mg_connection *conn, const struct mg_request_info
*ri, void *data)

The typo took only a few minutes to find but reduced the copy paste value
of it.   

So you know, I'm using mongoose in two different projects of mine and I
love it!  Thanks a serious amount for making something so awesome!

Original issue reported on code.google.com by [email protected] on 9 Feb 2009 at 8:08

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.