Re: Unable to access .CGI on embedded web server

2019-07-16 Thread Sergey Lyubka
Try to run that CGI file by hands. On Tue, Jul 16, 2019 at 8:34 AM Diego Inoferio wrote: > Good Day. I’m currently developing an embedded device using mongoose as > the webserver. My goal is to parse the data from an HTML file and process > the data using CGI. I am able to setup the web server.

Re: Integrating into esp32

2017-09-28 Thread Sergey Lyubka
I suggest to use forum.mongoose-os.com for the questions. No, AT modem from espressif will not be a part of mongoose-os. On Wed, Sep 27, 2017 at 12:21 PM, Robin Gilks wrote: > Hi Sergey > > I came, I downloaded, I programmed and I have a flashing LED on my esp32, > after I

Re: Integrating into esp32

2017-09-26 Thread Sergey Lyubka
Robin, you want to look at https://mongoose-os.com/ On Tue, Sep 26, 2017 at 3:38 AM, Robin Gilks wrote: > Greetings all > > Been a while (shows a happy user!!) but I'm moving away from openwrt and > routers and getting interested in the Espressif esp32. > > I've grabbed the

Re: How to save the whole schema while not explicitly defining some of the fields

2016-09-19 Thread Sergey Lyubka
Wrong mailing list. This list is dedicated to https://github.com/cesanta/mongoose On Mon, Sep 19, 2016 at 11:18 AM, Michael Donux wrote: > Hi, my question is the title. And my example is as below: > > var catSchema = new Schema({ > name: String, > color: String,

Re: Embedding mongoose 6.4 in C# app

2016-07-08 Thread Sergey Lyubka
But with C# requirement - you're out of luck, unless your project is commercial and management is OK paying for the custom integration with c#. On Fri, Jul 8, 2016 at 4:55 PM, Sergey Lyubka <vale...@gmail.com> wrote: > Mongoose is designed to be used in C/C++ programs. > REStful +

Re: Embedding mongoose 6.4 in C# app

2016-07-08 Thread Sergey Lyubka
ions. I was hoping Mongoose would fit > to our needs. > Do you suggest something? Do you have any idea to get it working with > Mongoose? > > Thanks in advance! > > Em sexta-feira, 8 de julho de 2016 03:23:35 UTC-3, Sergey Lyubka escreveu: >> >> No, newer versio

Re: Embedding mongoose 6.4 in C# app

2016-07-08 Thread Sergey Lyubka
version 5.6 in my tests, but that's > because on version 5.6 Sergey Lyubka has already created a csharp example > class for a wrapper (5.6 > mongoose/examples/csharp/mongoose.cs). So it > wasn't so hard to make it works. > But on version 6.4 it has major changes and there is not a example of

Re: websockets - how to know when session ends

2016-05-23 Thread Sergey Lyubka
like I get some > orphan sessions laying around some times. > > > On Monday, May 23, 2016 at 11:47:10 AM UTC+2, Sergey Lyubka wrote: >> >> >> Sorry Ake, I didn't get your question :-) >> > -- > You received this message because you are subscribed to

Re: websockets - how to know when session ends

2016-05-23 Thread Sergey Lyubka
Sorry Ake, I didn't get your question :-) -- You received this message because you are subscribed to the Google Groups "mongoose-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to mongoose-users+unsubscr...@googlegroups.com. To post to this group,

Re: Getting Mongoose to build under Windows CE 6.0

2016-05-12 Thread Sergey Lyubka
Hi Brian, I suggest using forum.cesanta.com for the tech questions. We do not have a WinCE build as part of our CI testing, so we could not claim that we support CE, however people have reported it built in the past. If this is a commercial project, you can always resort to Cesanta commercial

Re: How to get mongoose to run index.html ?

2016-01-22 Thread Sergey Lyubka
Please use forum.cesanta.com for mongoose questions. On Fri, Jan 22, 2016 at 12:17 PM, vmars vernon wrote: > Hello & Thanks , > WIndows 10 x64 , Just downloaded mongoose & binary AND started > mongoose-free-6.1.exe . > How do I get it to run my index.html ? > I tried just

Re: Changing default browser working with Mongoose binary

2016-01-03 Thread Sergey Lyubka
If you put your index.html in the document root, it'll be opened. On Sun, Jan 3, 2016 at 4:22 PM, joefulls wrote: > Hi everybody, > > Is there anyway to force the mongoose web server to run using a specific > browser like (IE, Chrome, etc.)? > > I looks like mongoose fires

Re: Changing default browser working with Mongoose binary

2016-01-03 Thread Sergey Lyubka
un it from another PC, it chooses to run > with the other PC's default browser, while I need it to work only with IE. > > So I'm looking for a way to tell mongoose: start the index.html using IE > (on all PCs), not the default browser (chrome, firefox, etc.). > > Any idea? > &g

Re: Generate Dynamic Listening port

2015-12-23 Thread Sergey Lyubka
Hi Wunna, We're discontinuing this mailing list, please use forum.cesanta.com for questions. Thanks! On Wed, Dec 23, 2015 at 2:10 AM, Wunna Lwin wrote: > Hi, > I am very new on mongoose and their is something I don't understanding in > new mongoose version 6.1. >

Re: TXT File Upload w/o GridFS using MEAN Stack

2015-12-08 Thread Sergey Lyubka
Josh, this mailing list is dedicated to the Mongoose web server, https://github.com/cesanta/mongoose On Tue, Dec 8, 2015 at 3:19 PM, Joshua Swiss wrote: > Hi All: > > Probably a bit of a noob question, but I'm using Node and Mongoose to > develop a site where budget data

Re: How to execute C based CGI binary with mongoose web server

2015-12-02 Thread Sergey Lyubka
On Wed, Dec 2, 2015 at 7:36 AM, Prasanth G wrote: > Hi Sergey, > > Thanks for responding. Me and Aurovind were using it in an embedded > platform which is linux based. > The configs we tried out are, > > mongoose > -document_root /cgi-bin/ > -cgi_pattern /cgi-bin/**.* >

Re: How to execute C based CGI binary with mongoose web server

2015-12-01 Thread Sergey Lyubka
Hi Aurovind. 1. What environment are you using? 2. Elaborate on what exactly config are you using and what results do you get. On Wed, Dec 2, 2015 at 6:29 AM, Aurovind Sagar wrote: > I am new to mongoose. What I got to know is that mongoose supports CGI > binary execution.

Re: Mongoose multithread restfull server

2015-11-05 Thread Sergey Lyubka
Thanks for the background. Note that thread are to be used in two situations: 1. Request handler needs to do some long computation or blocking call (e.g. read from a slow database) to serve the request. In that case, to avoid blocking other connections, request handler must be run in a

Re: mongoose windows binary

2015-11-05 Thread Sergey Lyubka
Hi Sourav, That is not possible, icon is always visible. On Tue, Nov 3, 2015 at 7:52 PM, Sourav Ghosh wrote: > I am using mongoose web server version 5.6 binary in my windows machine. > When it is running, its icon is shown in the notification box at the right > of

Re: Problem to display image in web page

2015-11-05 Thread Sergey Lyubka
venience > > > > Il giorno sabato 31 ottobre 2015 08:32:11 UTC+1, Sergey Lyubka ha scritto: > >> Hi Maurizio, >> >> Don't mix mg_serve_http() with your own output. >> Either send the data yourself (mg_send(), mg_printf(), etc) or call >> mg_serve_ht

Re: URL rewrites

2015-11-05 Thread Sergey Lyubka
You can put all dynamic content into some directory, and have a rewrite rule that starts with that directory prefix. url_rewrites /api/**=/full/path/to/your/exe On Thu, Nov 5, 2015 at 10:23 AM, apomin wrote: > Hi, > > Thank you, it works > However, it passes all requests

Re: json parser frozen

2015-10-31 Thread Sergey Lyubka
Hi, at the moment there is no suitable API for that. Do you have a suggestion for the API ? Regards, On Thu, Oct 22, 2015 at 1:02 PM, fs wrote: > Hallo, > > how to get elements of an json array without keys using frozen.h ( I know > it is part of mongoose nowadays.)

Re: Problem to display image in web page

2015-10-31 Thread Sergey Lyubka
; " GOOD MORNING! This root directroy " > "" > " " > " " > " " > " border-radius: 3px;\">" > "50px; border-radius: 3px;\">" > "

Re: mongoose server 6.0 multithread pool

2015-10-29 Thread Sergey Lyubka
Yes, this is because you cannot bind more than one connection to the port. You can work around this: 1. create first manager, and bind it to the port: struct mg_connection *c = mg_bind(mgr1, s_http_port, ev_handler); 2. from the listening connection, get the socket: sock_t sock = c->sock;

Re: mongoose-users@googlegroups.com

2015-09-07 Thread Sergey Lyubka
Hi Xitaotao, Latest Mongoose is singly threaded. On Mon, Sep 7, 2015 at 8:53 AM, wrote: > Hi,I have a question about Mongoose thread model. > I want to know the thread model of Mongoose of the latest version which is > 5.7.I've view the source code of Mongoose,but it's

Re: where to find all the old examples?

2015-09-07 Thread Sergey Lyubka
Do you mean, these examples https://github.com/cesanta/mongoose/tree/master/examples ? On Mon, Sep 7, 2015 at 3:31 PM, wrote: > Hey List, > there has been more than 16 examples, but now they are deleted. Why? I > really liked them. > Regards > > -- > You received this

Re: Multiple NICS

2015-08-18 Thread Sergey Lyubka
Just bind to a specific IP address listening_ports 1.2.3.4:8080 On Tue, Aug 18, 2015 at 11:22 AM, jeff shanab jshana...@gmail.com wrote: I am using the older threaded version of Mongoose to simulate a CGI based device and would like to know how I can start mongoose on a particular NIC in

Re: websocket client

2015-08-16 Thread Sergey Lyubka
kevinzi...@gmail.com wrote: Yes, but I didn't find a websocket client example with c/c++. I want to use websocket in c/c++ desktop application to connect web server, instead of in web browser. On Saturday, August 15, 2015 at 6:32:38 AM UTC-7, Sergey Lyubka wrote: Did you look at https

Re: mongoose access log writing not threadsafe?

2015-08-15 Thread Sergey Lyubka
:56 UTC-7, Sergey Lyubka wrote: Thanks Terence. Honestly, I'd remove the locking alltogether. Normally, if different threads are writing a log file, separate files should be used anyway. On Tue, Aug 4, 2015 at 7:54 PM, Terence Martin walt...@gmail.com wrote: I'm looking at the code

Re: mongoose access log writing not threadsafe?

2015-08-14 Thread Sergey Lyubka
Thanks Terence. Honestly, I'd remove the locking alltogether. Normally, if different threads are writing a log file, separate files should be used anyway. On Tue, Aug 4, 2015 at 7:54 PM, Terence Martin walts@gmail.com wrote: I'm looking at the code in mongoose that writes to the configured

Re: Web server behind NAT

2015-08-13 Thread Sergey Lyubka
Hi Kevin, That kind of setup is usually done on a firewall side, as a port forwarding configuration. Mongoose, or any other web server software, has nothing to do with it. Sergey On Thu, Aug 13, 2015 at 5:07 PM, Kevin Zhang kevinzi...@gmail.com wrote: I would like to host web server behind

Re: Mongoose and array elements

2015-07-20 Thread Sergey Lyubka
Wrong mailing list. On Mon, Jul 20, 2015 at 5:18 PM, Satish B technotip.commun...@gmail.com wrote: Document: *User *collection { 'name': 'abc', watch : [ { cat_name : Satish, cat_id :

Re: Mongoose and array elements

2015-07-20 Thread Sergey Lyubka
, 2015 at 9:52:04 PM UTC+5:30, Sergey Lyubka wrote: Wrong mailing list. On Mon, Jul 20, 2015 at 5:18 PM, Satish B technotip...@gmail.com wrote: Document: *User *collection { 'name': 'abc', watch : [ { cat_name : Satish

Re: multiple sites - one code base

2015-07-01 Thread Sergey Lyubka
Hi Justin, you're writing to the wrong mailing list. On Wed, Jul 1, 2015 at 5:48 AM, Justin Young s...@thisishis.com wrote: Running a MEAN stack. I'd like to be able to use one codebase and have all my sites tie in. Should I have separate databases that my various URL's data go into or

Re: mg_write is much slower than mg_send_header + mg_printf_data

2015-06-19 Thread Sergey Lyubka
mg_printf_data() uses chunked encoding, which sends content length to the client automatically. mg_printf() doesn't do that, it sends data as-is. If you don't send content length, client assumes that the content ends when TCP connection is closed, and waits for the continuation until timeout. On

Re: cookie_authentication example no server response

2015-06-05 Thread Sergey Lyubka
I think https://github.com/cesanta/mongoose/commit/564683d25a6601087e8e936acfef240996425441 fixes that, please try the latest version. On Sun, May 3, 2015 at 6:47 PM, mongooseuser...@gmail.com wrote: Hi, I tried the cookie_authentication example with no success. Compiling and running

Re: Help with installing mongoose on Mac Yosemite using homebrew

2015-06-03 Thread Sergey Lyubka
Hi Alan, you can repeat these commands and try to run mongoose using the full path: *$ brew info mongoose* mongoose: stable 5.1https://github.com/valenok/mongoose /usr/local/Cellar/mongoose/5.1 (37 files, 308K) * Built from source From:

Re: The event handler is looping

2015-05-27 Thread Sergey Lyubka
I cannot reproduce the problem - everything works as expected. What version of Mongoose are you using? On Sat, May 23, 2015 at 9:46 PM, Johan stack.s...@gmail.com wrote: Hi I am working on an embedded server using mongoose server. I have the following code fromMongoose Doc

Re: Handling static files like css, jpg e.g.

2015-04-22 Thread Sergey Lyubka
1. Specify document_root option. 2. In a handler, return MG_FALSE for non-API calls. That tells mongoose to serve static content from document_root. static int ev_handler(struct mg_connection *conn, enum mg_event ev) { switch (ev) { case MG_AUTH: return MG_TRUE; case MG_REQUEST: if

Re: Compressing responses when Accept-Encoding:gzip request header is set

2015-04-16 Thread Sergey Lyubka
Hi Jamie, Mongoose cannot gzip-encode the content. On Thu, Apr 16, 2015 at 2:43 PM, Jamie Vicary jamievic...@gmail.com wrote: Hello, Does a server built with mongooselib automatically compress files before sending, in response to an Accept-Encoding:gzip request header? If now, how can this

Re: Handler is blocking

2015-04-05 Thread Sergey Lyubka
*response* can be larger than 8KB, does that seems a problem? - Should I slice my *response* in 8KB maximum chunks an call mg_wakeup_server_ex several times? Thanks. Carlos On Sat, Apr 4, 2015 at 7:55 PM, Sergey Lyubka vale...@gmail.com wrote: Hey Carlos :-) Here I am to help ! It is a lovely

Re: Handler is blocking

2015-04-04 Thread Sergey Lyubka
Hey Carlos :-) Here I am to help ! It is a lovely Saturday evening in Dublin, exactly the right time for that. Note that it is an error to pass a connection structure to a different thread. Mongoose can kill the connection pretty much at any time, and the pointer that other thread holds will be

Re: Strange(?) behavior in event handler

2015-03-27 Thread Sergey Lyubka
:01 PM UTC+1, Sergey Lyubka wrote: Okay, intermittent things are hard to spot and debug. But let's narrow down. It happens with long POSTs, maybe there are some specific POSTs? Are they long because lots of data being uploaded, or they just hanging? On Mon, Mar 16, 2015 at 8:57 PM, Tor Krill

Re: mongoose to return 200ok on 443 requests

2015-03-10 Thread Sergey Lyubka
for the follow up. You're welcome! On Monday, March 9, 2015 at 11:18:16 AM UTC-4, Sergey Lyubka wrote: There is no way to do it. SSL connection must be terminated before redirection happens. On Mon, Mar 9, 2015 at 3:15 PM, Kaladin Light 0.ka...@gmail.com wrote: On its own. There is stuff

Re: mongoose to return 200ok on 443 requests

2015-03-09 Thread Sergey Lyubka
then the normal send_reply func would kick in and return the 200 ok blank page. On Monday, March 9, 2015 at 5:36:34 AM UTC-4, Sergey Lyubka wrote: Just to clarify, is that app supposed to be used as a proxy, or it is supposed to serve requests on it's own? -- You received this message because

Re: mongoose to return 200ok on 443 requests

2015-03-09 Thread Sergey Lyubka
Just to clarify, is that app supposed to be used as a proxy, or it is supposed to serve requests on it's own? On Sun, Mar 8, 2015 at 9:15 PM, Kaladin Light 0.kala...@gmail.com wrote: I have mongoose listening on 80 and 443, compiling embedded. For any requests that come to it on port 80 it

Re: ipv6 when embedding mongoose

2015-03-08 Thread Sergey Lyubka
There is -DNS_ENABLE_IPV6 , documented at https://github.com/cesanta/mongoose/blob/master/docs/Embed.md On Mon, Mar 2, 2015 at 2:00 PM, rbli...@gmail.com wrote: On Monday, March 2, 2015 at 2:17:29 PM UTC+1, rbl...@gmail.com wrote: Hi, I'm using mongoose following the embeded mongoose

Re: Problem similar to mjpg_streamer (mongoose v5.5)

2015-03-08 Thread Sergey Lyubka
:41:39 (UTC+1), Sergey Lyubka escribió: Thanks. Could you elaborate on how do you reproduce the problem, please? On Wed, Jan 7, 2015 at 5:40 PM, mories m.ortega...@gmail.com wrote: I have similar problems to those that occur in your mjpg_streamer.c example: - the last piece of the last

Re: SOAP Web Service

2015-03-06 Thread Sergey Lyubka
SOAP can use HTTP as transport, so Mongoose would be a good fit for it. SOAP layer just must use XML parser to parse HTTP payload, which is a SOAP message. There no SOAP specific examples, but there are plenty of others at https://github.com/cesanta/mongoose/tree/master/examples The easiest way

Re: directory listing exception

2015-03-03 Thread Sergey Lyubka
That is not possible by configuration. The work-around would be to add an empty index.html files into directories that must not be listed. On Fri, Feb 13, 2015 at 11:14 PM, Roberto Clemente roberto.clemente.bustama...@gmail.com wrote: Hi! first of all, thank you for this unvaluable piece of

Re: potential mongoose 5.5 SSL issue

2015-02-16 Thread Sergey Lyubka
Thanks Sebastian. Pushed https://github.com/cesanta/mongoose/commit/44a146faf6423729a2d0e873d872f609687a01f6 Could you confirm it works for you, please? On Thu, Jan 15, 2015 at 9:53 AM, sebastian.pusch...@googlemail.com wrote: Hello, I had a related issue. On a SSL encrypted connection using

Re: Changing the web browser display of a raw directory listing

2015-01-02 Thread Sergey Lyubka
want it. On Fri, Jan 2, 2015 at 9:40 AM, Sergey Lyubka vale...@gmail.com wrote: You can run a periodic job on the server machine to generate index.html files in the directories with movies. On Fri, Jan 2, 2015 at 2:32 PM, Peter procyo...@gmail.com wrote: On Saturday, 3 January 2015 01:03:27

Re: Changing the web browser display of a raw directory listing

2015-01-02 Thread Sergey Lyubka
On Fri, Jan 2, 2015 at 1:53 PM, Peter procyo...@gmail.com wrote: On Saturday, 3 January 2015 00:25:21 UTC+11, Sergey Lyubka wrote: Greasemonkey allows to execute user-specified JavaScript code on certain web pages. In your case, a simple JavaScript can do what you want - filter out stuff

Re: Changing the web browser display of a raw directory listing

2015-01-02 Thread Sergey Lyubka
On Fri, Jan 2, 2015 at 1:07 PM, Peter procyo...@gmail.com wrote: Is there a method to change the information that a web browser displays of a raw directory listing? Cab this be done server side or is it something that the web browser has to change? I'm using an Android web browser and

Re: Changing the web browser display of a raw directory listing

2015-01-02 Thread Sergey Lyubka
On Fri, Jan 2, 2015 at 3:24 PM, Peter procyo...@gmail.com wrote: On Saturday, 3 January 2015 01:40:39 UTC+11, Sergey Lyubka wrote: You can run a periodic job on the server machine to generate index.html files in the directories with movies. That is something I can handle, if need

Re: Mongoose or Fossa

2014-12-28 Thread Sergey Lyubka
Fossa has support for other protocols - DNS, MQTT, plain TCP/UDP. Also, Fossa has Websocket client while Mongoose doesn't (they both have Websocket server though). Fossa will continue to expand it's protocol support, while Mongoose will stay HTTP/Websocket only. Bottom line: if you plan for

Re: Downloading Mongoose 5.5 pro

2014-12-22 Thread Sergey Lyubka
There are complaints about AV triggering on Mongoose executable. As CTO of Cesanta Software and Mongoose author, I can reassure they are false positives. On Mon, Dec 22, 2014 at 1:00 AM, Covert Nelson sirveyor...@gmail.com wrote: I am running Win 7 pro sp1 and avast antivirus. Avast flags the

Re: Server hanging while client keeps connection open

2014-12-11 Thread Sergey Lyubka
On Thu, Dec 11, 2014 at 5:02 PM, Timur khani...@gmail.com wrote: Thanks. I've had a brief look at mongoose 5.6 (which occured to have a very different license than version 3). Indeed it has a completely different mechanism for handling requests. And I do see one way of solving my problem

Re: is mg_websocket_write( ) thread safe ?

2014-12-01 Thread Sergey Lyubka
mg_websocket_write() is NOT threadsafe. Either use mutexes to serialize writes, or use mg_wakeup_server_ex() to safely push messages to websocket connections. On Mon, Dec 1, 2014 at 11:55 AM, swati joshi bjsw...@gmail.com wrote: Hi , I am using mg_websocket_write( ) API to write into the

Re: mongoose.dll for C#?

2014-11-14 Thread Sergey Lyubka
, Peter Purnyn mpur...@gmail.com wrote: Where does the build directory exist? I can't find it on Github. On Friday, November 22, 2013 8:49:16 AM UTC-5, Sergey Lyubka wrote: You can build the DLL yourself, run make mongoose.dll in build/ directory. On Sun, Nov 3, 2013 at 6:36 PM, rohininandana

Re: Mongoose server as http client

2014-11-13 Thread Sergey Lyubka
Ah I see. Use mg_printf(). On Thu, Nov 13, 2014 at 11:20 AM, Darius Remeika rdar...@gmail.com wrote: Still the same issue. On Thursday, November 13, 2014 6:18:14 AM UTC-5, Sergey Lyubka wrote: Try to use \n instead of \r\n On Thu, Nov 13, 2014 at 11:09 AM, Darius Remeika rda...@gmail.com

Re: How to send chunked header data to Client ?

2014-11-10 Thread Sergey Lyubka
On Mon, Nov 10, 2014 at 4:37 AM, Kunal Kulshrestha kulshrestha.ku...@gmail.com wrote: Hi Sergey, We used curl to fetch data(response) from external server over http protocol and use mongoose mg_send_data or mg_send_header to send the headers back to client. The question is how to make sure

Re: Mongoose 3.0 : How to pass user_data at event handler fn call?

2014-11-07 Thread Sergey Lyubka
Hi Puneet, Older Mongoose doesn't allow to set user_data from within the callback. On Tue, Nov 4, 2014 at 10:53 AM, Puneet Bakshi bakshi.pun...@gmail.com wrote: I need to use Mongoose 3.0 for some reason. But, I am facing a problem related to passing user_data. Looks like this Mongoose version

Re: What happened to ssl_certificate

2014-11-06 Thread Sergey Lyubka
See listening_port option at https://github.com/cesanta/mongoose/blob/master/docs/Options.md To enable SSL, set listening_port to ssl://PORT:SSL_CERTIFICATE_FILE.PEM On Thu, Nov 6, 2014 at 9:40 AM, sun bean sunb...@email.it wrote: Hi, in an embedded router project, I use mongoose as base for

Re: Mongoose 3.0: Receive garbage request data sent in POST call

2014-11-06 Thread Sergey Lyubka
You're using quite old version of mongoose - please switch to the newer one. It has plenty of examples, I suggest checking out this one https://github.com/cesanta/mongoose/tree/master/examples/form_submit On Wed, Nov 5, 2014 at 1:06 PM, Puneet Bakshi bakshi.pun...@gmail.com wrote: Hi, I am

Re: REGEX - SLRE Library

2014-10-30 Thread Sergey Lyubka
That's easy to process with sscanf, see example: char buf1[100], buf2[100]; if (sscanf(str, /apiv1/data/%99[^/]/%99[^/]/, buf1, buf2) == 2) { printf([%s] [%s] \n, buf1, buf2); } On Thu, Oct 30, 2014 at 11:52 AM, Carlos Tangerino carlos.tanger...@gmail.com wrote: Anyone using

Re: abrupt hanging / blocking of mongoose web server

2014-10-29 Thread Sergey Lyubka
to reproduce the problem in a non-production server, under a debugger. I put a breakpoint on the code that exited the server when it hangs, and when it was hit I looked at what the threads were up to. One was in a tight loop and had smashed memory. On Mon, Oct 27, 2014 at 9:04 AM, Sergey Lyubka vale

Re: abrupt hanging / blocking of mongoose web server

2014-10-27 Thread Sergey Lyubka
. Unfortunately at about one crash a day, the printf method of debugging is slow. On Thu, Oct 23, 2014 at 2:48 PM, Sergey Lyubka vale...@gmail.com wrote: Disconnects could be because either server closes the connection, or server hangs and doesn't send PINGs. So server hanging could be the roots

Re: abrupt hanging / blocking of mongoose web server

2014-10-23 Thread Sergey Lyubka
is looking an errno after a call to recv() *on Windows*. errno could have a value of EAGAIN for all sorts of reasons, but recv() isn't one of them. And if you're going to check errno on unix you need to set it to 0 before calling recv... On Wed, Oct 22, 2014 at 2:59 PM, Sergey Lyubka vale

Re: abrupt hanging / blocking of mongoose web server

2014-10-23 Thread Sergey Lyubka
and looking up the connection, so I'm fairly certain I can't ever get a dead one. On Thu, Oct 23, 2014 at 6:12 AM, Sergey Lyubka vale...@gmail.com wrote: you can pass the pointers to the connection objects to other threads, but you should know what you're doing. Any mg_poll_server() call can destroy

Re: abrupt hanging / blocking of mongoose web server

2014-10-23 Thread Sergey Lyubka
. People doing what I'm doing, trying to get more thread safety, could use them to manage locking. On Thu, Oct 23, 2014 at 12:01 PM, Sergey Lyubka vale...@gmail.com wrote: Provided low intensity of your IO, I doubt that unprotected writes caused the issue you're talking about. The lockup is due

Re: abrupt hanging / blocking of mongoose web server

2014-10-22 Thread Sergey Lyubka
Okay, let me setup long-running stress test to catch that. In the mean time, you might want to try net skeleton which has much more light implementation of http/websocket functionality, examples are at https://github.com/cesanta/net_skeleton/tree/master/examples (note that net skeleton currently

Re: Mongoose pro 5.4.2 not recognizing ssl_certificate option

2014-10-20 Thread Sergey Lyubka
Hi Kenvin, Just to clarify: are you using pre-built binary, or building one on your own (with SSL support)? On Sat, Oct 18, 2014 at 8:03 PM, 'Kevin Williams' via mongoose-users mongoose-users@googlegroups.com wrote: This is running on Windows. I have the following in my config file - #

Re: Get -DMONGOOSE_NO_DIRECTORY_LISTING to work

2014-10-16 Thread Sergey Lyubka
Pushed https://github.com/cesanta/mongoose/commit/1ab704ac92521e8e9f4b451dd8186955e3113b1b to fix. Thanks! On Thu, Oct 16, 2014 at 10:12 AM, Bob Rubbens bobrubb...@gmail.com wrote: Hi everyone, I'm a bit of a c++ scrub so I'm probably missing something here, but I can't compile libmongoose

Re: past upload code

2014-10-15 Thread Sergey Lyubka
Github stores all the previous versions of the code - you can easily find anything yourself. I am surprised though you can't upload tar files - can you elaborate what the problem is please? On Tue, Oct 14, 2014 at 6:28 PM, lordsanche...@gmail.com wrote: Hi Sergey, a few months ago I started a

Re: Assignment

2014-10-15 Thread Sergey Lyubka
Hi Archit, could you elaborate what exactly did you try to build a server? Also, I am curious what college you're attending that gives assignments based on mongoose? Thanks On Tue, Oct 14, 2014 at 10:23 PM, Archit Garg architgarg1...@gmail.com wrote: yeah i am in serious need of help ..

Re: Behavior when client presses Control-C (^C) before request completes

2014-10-09 Thread Sergey Lyubka
Hi Puneet, On step 4, an old connection got MG_CLOSE. That's expected. Every connection gets MG_POLL if it takes more then one mg_poll_server() cycles to serve it. That is also expected. My understanding is that you do not see MG_REQUEST for the new connections. Is that correct? On Tue, Oct 7,

Re: Chat.c example

2014-10-09 Thread Sergey Lyubka
https://github.com/cesanta/mongoose/tree/master/examples/cookie_authentication On Wed, Oct 8, 2014 at 10:27 PM, jordi jordi90 lordsanche...@gmail.com wrote: Could you put and example pls!! It would be really usefull!! 2014-10-08 23:07 GMT+02:00 Sergey Lyubka vale...@gmail.com: Is restful

Re: Chat.c example

2014-10-08 Thread Sergey Lyubka
will decide if he can do or not, so maybe showing an error message and redirecting him to the login page. Thanks On Sunday, October 5, 2014 6:28:41 PM UTC+2, Sergey Lyubka wrote: chat.c has been removed. You can take a look at the older releases for the reference: https://github.com/cesanta

Re: Chat.c example

2014-10-05 Thread Sergey Lyubka
chat.c has been removed. You can take a look at the older releases for the reference: https://github.com/cesanta/mongoose/blob/5.0/examples/chat.c We'll add a separate example for cookie-based auth soon. On Sun, Oct 5, 2014 at 12:08 PM, Carlos Tangerino carlos.tanger...@gmail.com wrote: The

Re: mg_parse_multipart is slightly vague - how to read an upload to a buffer?

2014-09-24 Thread Sergey Lyubka
Hi John, Is file upload example ( https://github.com/cesanta/mongoose/blob/master/examples/file_upload/file_upload.c) helpful for your case? On Wed, Sep 24, 2014 at 3:49 AM, John Peasley fireha...@gmail.com wrote: I've got a situation where I need to be able to use mg_parse_multipart to accept

Re: Using mongoose for heavy traffic on websocket using mg_wakeup_server

2014-09-24 Thread Sergey Lyubka
the same issue i.e. high frequency data communication makes the serving thread go in blocking state. I am looking for help. Please let me know if you have any questions. Regards, Kunal On Thursday, September 18, 2014 10:57:38 AM UTC-4, Sergey Lyubka wrote: Ah, ok. Date timestamp was introduced

Re: abrupt hanging / blocking of mongoose web server

2014-09-24 Thread Sergey Lyubka
Thanks. What's the os ? On Sep 24, 2014 10:32 AM, swati joshi bjsw...@gmail.com wrote: Hi, Just to add to the problem details to the above, I have the following observations: 1. The Polling thread blocks when there are huge numbers of requests coming in Ex: 100+ in a sec. Also, for each

Re: Mongoose picks wrong network when VMware Player is installed, and I can't change that?

2014-09-24 Thread Sergey Lyubka
You can set listening_port option to IP:PORT, where IP is the IP of the interface you'd like to bind to. On Wed, Sep 24, 2014 at 4:01 PM, Maarten Bijster maarten.bijster.authentic...@gmail.com wrote: Dear all, I've VMware Player on my Windows 8.1 system. When I start Mongoose, it picks a

Re: High CPU load with file transfer

2014-09-19 Thread Sergey Lyubka
by far). Am Mittwoch, 17. September 2014 09:54:11 UTC+2 schrieb Sergey Lyubka: Well if that is memcpy, then I don't find it surprising. Server is mostly doing data copying, reading from file and copying to the socket. On Sat, Sep 13, 2014 at 12:11 PM, Marcel Wirtz pyr...@gmail.com wrote

Re: how to send error code to client in case of improper request

2014-09-19 Thread Sergey Lyubka
mg_send_status(conn, HTTP_ERROR_CODE); mg_send_data(conn, , 0); return MG_TRUE; On Thu, Sep 18, 2014 at 3:22 AM, Giridhar Addepalli giridhar1...@gmail.com wrote: Hi All, I want to build a embedded http server( which serves files from local disk to clients ) in to my c++ application. I want

Re: Using mongoose for heavy traffic on websocket using mg_wakeup_server

2014-09-18 Thread Sergey Lyubka
Hi Kunal, what is the $Date$ timestamp of your mongoose.c file? On Thu, Sep 18, 2014 at 12:28 AM, kk kunalkulshrestha1...@gmail.com wrote: Hi, I am working on an application in which I am using mg_wakeup_server API to push data over websocket connection. As guided for Mongoose usage, I have

Re: Using mongoose for heavy traffic on websocket using mg_wakeup_server

2014-09-18 Thread Sergey Lyubka
: ## Release 5.4, July 28 2014 How should I find date and timestmap? Regards, Kunal On Thursday, September 18, 2014 4:25:22 AM UTC-4, Sergey Lyubka wrote: Hi Kunal, what is the $Date$ timestamp of your mongoose.c file? On Thu, Sep 18, 2014 at 12:28 AM, kk kunalkulsh...@gmail.com wrote

Re: Accessing my own object inside ev_handler

2014-09-17 Thread Sergey Lyubka
Pass pointer to your object to the mg_create_server() function. In the even handler, it'll be mg_connection::server_param. On Wed, Sep 17, 2014 at 6:59 AM, Giridhar Addepalli giridhar1...@gmail.com wrote: Hi All, I am newbie to mongoose. I am trying to have an embedded mongoose server in my

Re: How to pass user context and how to determine whether it is a new connection?

2014-09-13 Thread Sergey Lyubka
On Sat, Sep 13, 2014 at 9:36 AM, Terence Martin walts@gmail.com wrote: It's been my experience that MG_POLL is always the first event that triggers for a new connection. I've always assumed that this is because the new connection is accepted and stored before the poll starts to walk the

Re: High CPU load with file transfer

2014-09-11 Thread Sergey Lyubka
Are you using mg_send_file() ? On Thu, Sep 11, 2014 at 10:31 AM, Marcel Wirtz pyr0...@gmail.com wrote: Hi, I did some tests with the fiels example application. When serving lage files, the CPU load of the application is very high. After some research with callgrind, I located the problem in

Re: time complexity of save and update

2014-09-01 Thread Sergey Lyubka
Hi, On Mon, Sep 1, 2014 at 1:29 PM, Vishnu Kumar Reddy Yanala vishnu.shoppi...@gmail.com wrote: I want to push data into nested json. collection.update is efficient or collection.save The first step would be to ask on a right mailing list :-) This mailing list is dedicated to mongoose web

Re: mg_write returns inconsistent length

2014-08-29 Thread Sergey Lyubka
Hi Gregory! I believe you're talking about mg_send_data() function, not mg_send(). mg_send() returns either 0 or the 3rd parameter, number of bytes mg_send_data() returns the size of output IO buffer. Both functions do not send data to the socket. mg_printf() and mg_printf_data() are the same in

Re: mg_write returns inconsistent length

2014-08-29 Thread Sergey Lyubka
just using mg_write -- which is what I used with the old version of the server without a problem. Using mg_send and mg_send_data has the same behavior. Greg On Thursday, August 28, 2014 11:02:26 PM UTC-7, Sergey Lyubka wrote: Hi Gregory! I believe you're talking about mg_send_data

Re: mg_write returns inconsistent length

2014-08-29 Thread Sergey Lyubka
Basically, if mg_write() is used, then HTTP headers must include content-length: case MG_REQUEST: mg_write(conn, HTTP/1.0 200 OK\r\n Content-Length: %d\r\n\r\n, my_len); mg_write(conn, ...); // frames. Total data len must be my_len mg_write(conn, ...);

Re: mg_write returns inconsistent length

2014-08-29 Thread Sergey Lyubka
just looped calling my getframe() which blocked until the frame is ready. On Fri, Aug 29, 2014 at 3:55 PM, Sergey Lyubka vale...@gmail.com wrote: Basically, if mg_write() is used, then HTTP headers must include content-length: case MG_REQUEST: mg_write(conn, HTTP/1.0 200 OK\r\n

Re: concurrent requests?

2014-08-25 Thread Sergey Lyubka
On Mon, Aug 25, 2014 at 4:36 PM, Scott Ellis scooterel...@gmail.com wrote: Hi Sergey, you said: Blocking or otherwise long-running operations must be moved to dedicated threads. A callback that needs to get a result of long-running operation should schedule it, return MG_MORE -- and not block

Re: What happens to mg_connection* after MG_CLOSE ?

2014-08-22 Thread Sergey Lyubka
On Fri, Aug 22, 2014 at 5:20 PM, Scott Ellis scooterel...@gmail.com wrote: Hi, I am curious, if the callback function you pass to mg_wakeup_server_ex() is called on every connection pointer that mongoose is holding, then how do you make sure the response you want to send goes to the correct

Re: concurrent requests?

2014-08-08 Thread Sergey Lyubka
Mongoose releases, including 5.4, are here: https://github.com/cesanta/mongoose/releases Please read the docs as well, many things are explained there: http://cesanta.com/docs/Embed.shtml http://cesanta.com/docs/API.shtml On Fri, Aug 8, 2014 at 5:32 PM, Scott Ellis scooterel...@gmail.com wrote:

Re: Get a value from option form, in C using mongoose.

2014-08-02 Thread Sergey Lyubka
Do the same as in this example: https://github.com/cesanta/mongoose/blob/master/examples/post.c On Sat, Aug 2, 2014 at 1:03 PM, jordi jordi90 lordsanche...@gmail.com wrote: Thank you very much, i will search in those direction. 2014-08-02 13:08 GMT+02:00 chrisj194...@gmail.com: Since

  1   2   >