mirror of
https://github.com/KarnerF/SMPlusGui.git
synced 2026-10-06 08:00:19 +02:00
Fix: rename g_mgr to smg_mgr to avoid mongoose.h conflict
This commit is contained in:
1 parent
05f74f43d2
commit
8877dc19e7
1 file changed
+3
-3
@@ -791,7 +791,7 @@ static void *sm_memmem(const void *haystack, size_t hlen, const void *needle, si
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static struct mg_mgr *g_mgr = NULL; /* global for send_elf_to_elfldr chunked send */
|
||||
static struct mg_mgr *smg_mgr = NULL; /* for send_elf_to_elfldr chunked send */
|
||||
static int send_elf_to_elfldr(const char *path) {
|
||||
FILE *elf = fopen(path,"rb"); if(!elf) return -1;
|
||||
int ports[]={9021,9020,0}; int sock=-1;
|
||||
@@ -813,7 +813,7 @@ static int send_elf_to_elfldr(const char *path) {
|
||||
while(off<n){ssize_t s=send(sock,buf+off,n-off,0);if(s<=0){err=1;break;}off+=(size_t)s;}
|
||||
if(err) break;
|
||||
/* let Mongoose handle pending requests every 8 chunks (~32KB) */
|
||||
if(g_mgr&&(++chunks%8)==0) mg_mgr_poll(g_mgr,0);
|
||||
if(smg_mgr&&(++chunks%8)==0) mg_mgr_poll(smg_mgr,0);
|
||||
}
|
||||
close(sock); fclose(elf);
|
||||
return err ? -3 : 0;
|
||||
@@ -2652,7 +2652,7 @@ int payload_main(void) {
|
||||
else snprintf(_url, sizeof(_url), "Port " HTTP_PORT);
|
||||
_notify_send("SMPlusGui v" SMPLUS_VERSION, _url);
|
||||
struct mg_mgr mgr;
|
||||
g_mgr = &mgr;
|
||||
smg_mgr = &mgr;
|
||||
mg_mgr_init(&mgr);
|
||||
mg_http_listen(&mgr,"http://0.0.0.0:" HTTP_PORT,fn,NULL);
|
||||
int polls=0, as_done=0;
|
||||
|
||||
Reference in new issue
Block a user