Unnamed Fossil Project

Check-in [b4acdb14a7]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:beta.teggo.cl opened
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:b4acdb14a757c23546b7f7eab91f3b5009943f4a
User & Date: alexey@sudachen.name 2012-06-13 01:01:27
Context
2012-06-15
08:42
updated check-in: 9f23bb5003 user: alexey@sudachen.name tags: trunk
2012-06-13
01:01
beta.teggo.cl opened check-in: b4acdb14a7 user: alexey@sudachen.name tags: trunk
2012-06-09
09:51
updated check-in: 81a745c894 user: alexey@sudachen.name tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to asio.hc.

388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
  }
#endif
  ;

void Asio_Interrupt(socket_t fd)
#ifdef _YOYO_ASIO_BUILTIN
  {
    Asio_Complete(fd,ASIO_INTERRUPT);
  }
#endif
  ;
  
int Asio_Recv(socket_t fd, void *dta, int count, int mincount, void *obj, asio_recv_callback_t callback)
#ifdef _YOYO_ASIO_BUILTIN
  {







|







388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
  }
#endif
  ;

void Asio_Interrupt(socket_t fd)
#ifdef _YOYO_ASIO_BUILTIN
  {
    Asio_Complete(fd,ASIO_INTERRUPTED);
  }
#endif
  ;
  
int Asio_Recv(socket_t fd, void *dta, int count, int mincount, void *obj, asio_recv_callback_t callback)
#ifdef _YOYO_ASIO_BUILTIN
  {

Changes to httpd.hc.

79
80
81
82
83
84
85

86
87
88
89
90
91
92
...
101
102
103
104
105
106
107


108
109
110
111
112
113
114




115
116
117
118
119
120
121
...
619
620
621
622
623
624
625

626
627
628
629
630
631
632
...
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
    /* request */    
    void *instrm;
    char *instrm_type; /*handle by qhdr*/
    int   instrm_length;
    YOYO_DICTO  *qhdr;
    
    char *uri;

    char *remote_addr;
    int   remote_port;
    int   method;
    int   httpver;
        
    /* response */
    void *outstrm;
................................................................................
  
    /* internal */    
    YOYO_TCPSOK *sok;
    YOYO_HTTPD  *httpd;
    int nline;
    int left;
    struct _YOYO_HTTPD_REQUEST *next;


  } YOYO_HTTPD_REQUEST;

void Httpd_Detach_Request(YOYO_HTTPD_REQUEST *rqst)
#ifdef _YOYO_HTTPD_BUILTIN
  {
    YOYO_HTTPD *httpd = rqst->httpd;
    YOYO_HTTPD_REQUEST **q = &httpd->rqst;




    while ( *q )
      {
        if ( *q == rqst )
          {
            *q = rqst->next;
            rqst->next = 0;
            break;
................................................................................
            ++i;
            while ( rqst->nline < i )
              { nonempty |= !Isspace(bf->at[rqst->nline]); ++rqst->nline; }
            if ( nonempty )
              goto next_line;
            Httpd_Analyze_Qline(bf->at,rqst);
            Httpd_Analyze_Headers(bf->at,rqst->qhdr);

            if ( rqst->method == HTTPD_POST_METHOD 
              || rqst->method == HTTPD_PUT_METHOD )
              {
                memmove(bf->at,bf->at+rqst->nline,bf->count-rqst->nline);
                bf->count -= rqst->nline;
                rqst->left = Str_To_Int(Dicto_Get(rqst->qhdr,"CONTENT-LENGTH","0"));
                rqst->instrm_type = Str_Trim_Copy_Npl(Dicto_Get(rqst->qhdr,"CONTENT-TYPE","text/html"),-1);
................................................................................
    httpd->host = Str_Copy_Npl(host,-1);
    httpd->port = port;
    Tcp_Asio_Accept(httpd->sok,httpd,Cbk_Httpd_Accept);
  }
#endif
  ;
  
void Http_Shutdown(YOYO_HTTPD *httpd)
#ifdef _YOYO_HTTPD_BUILTIN
  {
    Tcp_Asio_Shutdown(httpd->sok);
  }
#endif
  ;
  







>







 







>
>







>
>
>
>







 







>







 







|







79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
...
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
...
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
...
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
    /* request */    
    void *instrm;
    char *instrm_type; /*handle by qhdr*/
    int   instrm_length;
    YOYO_DICTO  *qhdr;
    
    char *uri;
    char *referer;
    char *remote_addr;
    int   remote_port;
    int   method;
    int   httpver;
        
    /* response */
    void *outstrm;
................................................................................
  
    /* internal */    
    YOYO_TCPSOK *sok;
    YOYO_HTTPD  *httpd;
    int nline;
    int left;
    struct _YOYO_HTTPD_REQUEST *next;
    
    void (*on_detach)(struct _YOYO_HTTPD_REQUEST *);
  } YOYO_HTTPD_REQUEST;

void Httpd_Detach_Request(YOYO_HTTPD_REQUEST *rqst)
#ifdef _YOYO_HTTPD_BUILTIN
  {
    YOYO_HTTPD *httpd = rqst->httpd;
    YOYO_HTTPD_REQUEST **q = &httpd->rqst;
    
    if ( rqst->on_detach )
      rqst->on_detach(rqst);
    
    while ( *q )
      {
        if ( *q == rqst )
          {
            *q = rqst->next;
            rqst->next = 0;
            break;
................................................................................
            ++i;
            while ( rqst->nline < i )
              { nonempty |= !Isspace(bf->at[rqst->nline]); ++rqst->nline; }
            if ( nonempty )
              goto next_line;
            Httpd_Analyze_Qline(bf->at,rqst);
            Httpd_Analyze_Headers(bf->at,rqst->qhdr);
            rqst->referer = Str_Trim_Copy_Npl(Dicto_Get(rqst->qhdr,"REFERER",0),-1);
            if ( rqst->method == HTTPD_POST_METHOD 
              || rqst->method == HTTPD_PUT_METHOD )
              {
                memmove(bf->at,bf->at+rqst->nline,bf->count-rqst->nline);
                bf->count -= rqst->nline;
                rqst->left = Str_To_Int(Dicto_Get(rqst->qhdr,"CONTENT-LENGTH","0"));
                rqst->instrm_type = Str_Trim_Copy_Npl(Dicto_Get(rqst->qhdr,"CONTENT-TYPE","text/html"),-1);
................................................................................
    httpd->host = Str_Copy_Npl(host,-1);
    httpd->port = port;
    Tcp_Asio_Accept(httpd->sok,httpd,Cbk_Httpd_Accept);
  }
#endif
  ;
  
void Httpd_Shutdown(YOYO_HTTPD *httpd)
#ifdef _YOYO_HTTPD_BUILTIN
  {
    Tcp_Asio_Shutdown(httpd->sok);
  }
#endif
  ;
  

Changes to tcpip.hc.

589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
  }
#endif
  ;

void Tcp_Asio_Shutdown(YOYO_TCPSOK *sok)
#ifdef _YOYO_TCPIP_BUILTIN
  {
    if ( sok->async )
      {
        socket_t skt = sok->skt;
        if ( skt != INVALID_SOCKET )
          {
            sok->skt = -1;
            /*fixme*/ //Asio_Shutdown(skt);
          }
      }
    else
      {
        shutdown(sok->skt,SB_BOTH);
        Tcp_Close(sok);
      }
  }
#endif
  ;

#endif /* C_once_F8F16072_F92E_49E7_A983_54F60965F4C9 */








<
<
<
|
<
|
<
<
<
<
<
<
|
<






589
590
591
592
593
594
595



596

597






598

599
600
601
602
603
604
  }
#endif
  ;

void Tcp_Asio_Shutdown(YOYO_TCPSOK *sok)
#ifdef _YOYO_TCPIP_BUILTIN
  {



    if ( sok->skt != INVALID_SOCKET )

      Asio_Interrupt(sok->skt);






    Tcp_Graceful_Close(sok);

  }
#endif
  ;

#endif /* C_once_F8F16072_F92E_49E7_A983_54F60965F4C9 */

Changes to url.hc.

105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#define Url_Parse(Url) Url_Parse_(Url,0)
#define Url_Parse_Uri(Url) Url_Parse_(Url,URLX_PARSE_NOHOST)
#define Url_Parse_Full(Url) Url_Parse_(Url,URLX_PARSE_ARGUMENTS)
YOYO_URL *Url_Parse_(char *url,int flags)
#ifdef _YOYO_URL_BUILTIN
  {
    YOYO_URL *urlout = 0;
    __Auto_Ptr(urlout)
      {
        /* proto://user:passwd@host:port/query#anchor?args */
      
        char *p;
        char *pS = url;
        
        char *proto = 0;







|







105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#define Url_Parse(Url) Url_Parse_(Url,0)
#define Url_Parse_Uri(Url) Url_Parse_(Url,URLX_PARSE_NOHOST)
#define Url_Parse_Full(Url) Url_Parse_(Url,URLX_PARSE_ARGUMENTS)
YOYO_URL *Url_Parse_(char *url,int flags)
#ifdef _YOYO_URL_BUILTIN
  {
    YOYO_URL *urlout = 0;
    if ( url ) __Auto_Ptr(urlout)
      {
        /* proto://user:passwd@host:port/query#anchor?args */
      
        char *p;
        char *pS = url;
        
        char *proto = 0;