PennMUSH Community

Changeset 1037

Show
Ignore:
Timestamp:
07/10/07 01:39:38 (1 year ago)
Author:
shawnw
Message:

#7407: Most of Intrevis' win32 fixes, and a slab allocator one that's not actually in danger of being triggered.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 1.8.3/branches/devel/src/bsd.c

    r1017 r1037  
    2525#include <winsock.h> 
    2626#include <io.h> 
     27#include <process.h> 
    2728#define EINTR WSAEINTR 
    2829#define EWOULDBLOCK WSAEWOULDBLOCK 
     
    278279#ifdef WIN32SERVICES 
    279280void shutdown_checkpoint(void); 
    280 void mainthread(int argc, char **argv); 
     281int mainthread(int argc, char **argv); 
    281282#else 
    282283int main(int argc, char **argv); 
     
    387388 * The real "main" is in win32/services.c 
    388389 */ 
    389 void 
     390int 
    390391mainthread(int argc, char **argv) 
    391392#else 
     
    411412    fputs("Please run the server as another user.\n", stderr); 
    412413    fputs("PennMUSH will not run as root as a security measure.\n", stderr); 
    413     return 1
     414    return EXIT_FAILURE
    414415  } 
    415416  /* Add suid-root checks here. */ 
     
    25682569{ 
    25692570  DESC *d, *dnext; 
     2571  const char *shutmsg; 
     2572  int shutlen; 
     2573 
     2574  shutmsg = T(shutdown_message); 
     2575  shutlen = strlen(shutmsg); 
    25702576 
    25712577  for (d = descriptor_list; d; d = dnext) { 
    25722578    dnext = d->next; 
     2579#ifdef HAS_OPENSSL 
    25732580    if (!d->ssl) { 
     2581#endif 
    25742582#ifdef HAVE_WRITEV 
    25752583      struct iovec byebye[2]; 
    2576       byebye[0].iov_base = (char *) T(shutdown_message)
    2577       byebye[0].iov_len = strlen(byebye[0].iov_base)
     2584      byebye[0].iov_base = (char *)shutmsg
     2585      byebye[0].iov_len = shutlen
    25782586      byebye[1].iov_base = "\r\n"; 
    25792587      byebye[1].iov_len = 2; 
    25802588      writev(d->descriptor, byebye, 2); 
    25812589#else 
    2582       const char *shutmsg = T(shutdown_message); 
    2583       send(d->descriptor, shutmsg, strlen(shutmsg), 0); 
     2590      send(d->descriptor, shutmsg, shutlen, 0); 
    25842591      send(d->descriptor, "\r\n", 2, 0); 
    25852592#endif 
    2586     } 
    25872593#ifdef HAS_OPENSSL 
    2588     if (d->ssl)
     2594    } else
    25892595      int offset; 
    2590       const char *shutmsg = T(shutdown_message); 
    25912596      offset = 0; 
    25922597      ssl_write(d->ssl, d->ssl_state, 0, 1, (uint8_t *) shutmsg, 
    2593                 strlen(shutmsg), &offset); 
     2598                shutlen, &offset); 
    25942599      offset = 0; 
    25952600      ssl_write(d->ssl, d->ssl_state, 0, 1, (uint8_t *) "\r\n", 2, &offset); 
  • 1.8.3/branches/devel/src/mymalloc.c

    r996 r1037  
    3636#include <unistd.h> 
    3737#endif 
    38 #ifdef WIN33
     38#ifdef WIN3
    3939#include <windows.h> 
    4040#endif 
     
    413413 
    414414  /* If objects are too big to fit in a single page, use plain free */ 
    415   if (sl->items_per_page == 0) 
     415  if (sl->items_per_page == 0) { 
    416416    free(obj); 
     417    return; 
     418  } 
    417419 
    418420  /* Find the page the object is on and push it into that page's free list */ 
  • 1.8.3/branches/devel/src/services.c

    r946 r1037  
    3131 
    3232int WIN32_CDECL main(int argc, char **argv); 
    33 void mainthread(int argc, char **argv); 
     33int mainthread(int argc, char **argv); 
    3434 
    3535 
     
    432432/*  start up the main MUSH code */ 
    433433 
    434   mainthread(argc, argv); 
     434  exit(mainthread(argc, argv)); 
    435435 
    436436}                               /*  end of worker_thread */ 
  • 1.8.3/branches/devel/win32/funs.h

    r978 r1037  
    6767FUNCTION_PROTO(fun_dbwalker); 
    6868FUNCTION_PROTO(fun_dec); 
     69FUNCTION_PROTO(fun_decode64); 
    6970FUNCTION_PROTO(fun_decompose); 
    7071FUNCTION_PROTO(fun_decrypt); 
     
    8586FUNCTION_PROTO(fun_elock); 
    8687FUNCTION_PROTO(fun_emit); 
     88FUNCTION_PROTO(fun_encode64); 
    8789FUNCTION_PROTO(fun_encrypt); 
    8890FUNCTION_PROTO(fun_endtag);