摘要:Failed requests: 537 (Connect: 0, Receive: 3, Length: 268, Exceptions: 266) Receive:当客户端connect成功后,并且服务端成功accept,并且没有开始recv,然后服务端close掉socket,就产生这个错误(
阅读全文
摘要:char* mstrncpy(char *dest, const char *src, size_t n){ size_t i; size_t j=n-1; for (i = 0 ; i < j && src[i] != '\0' ; i++) dest[i] = src[i]; dest[i] = '\0'; return de...
阅读全文
摘要:#include typedef struct{ int v; int (*next)(void); int (*error)(void); } context_t; context_t *ctx; int start_step(); int a_step(); int b_step(); int c_step(); int finish_step(); int ...
阅读全文
摘要:#include #include #include #include typedef struct{ int i; char str[16]; } d_t; #define SIZE_D_T 50 d_t *fill() { d_t *d = (d_t *)malloc(SIZE_D_T*sizeof(d_t)); d_t *p; p=d; ...
阅读全文
摘要:今天,当一个程序在epoll_wait阻塞时,用strace跟踪了一下,结果epoll_wait就被EINTR唤醒了,并且返回-1; 所以,当epoll_wait返回-1时,需要判断errno是不是EINTR,如果是,继续epoll_wait就行了。 还有,当一个进程没有子进程的时候,调用wait(
阅读全文
摘要:stmt = mysql_stmt_init(mysql) mysql_stmt_prepare(stmt, "SELECT ?", strlen("SELECT ?")) mysql_stmt_bind_param(stmt, param_bind) mysql_stmt_execute(stmt) mysql_stmt_bind_result(stmt, result_bind) mys...
阅读全文
摘要:#include #include #include using namespace std; #define N_K 10 struct Data_s{ int number; char name[20]; }; typedef struct Data_s Data_t; void makeData(Data_t *d) { int i; ...
阅读全文
摘要:#include #include #include using namespace std; #define N_K 10 typedef struct { int a; char b[8]; } Data_t; void makeData(Data_t *d) { int i; for (i=0;i m; Data_...
阅读全文
摘要:#include #include #include #include #include using namespace std; #define N_K 100 struct Data_s{ int number; char name[20]; bool operator (const Data_s &obj) const { return n...
阅读全文
摘要:C1->浏览器告知服务器自身的信息 length = 165 a5 16 03 01 00 A0 01 00 00 9C 03 03 5E 1C 37 CD 40 [ ^ 7 @] B6 4A 9A 1A BC 43 85 2D 91 6E 24 D1 CB 98 D2 67 [ J C - n$ g] 30 7B B9 34 F6 34 14 51 89 62 ...
阅读全文
摘要:例如请求的url http://172.28.250.184:8099/aa.php?var=ccccc&value=bbbbbb 前两个字节分别代表 变量名长度 和 变量值长度。 0x0f0x0fSCRIPT_FILENAME/scripts/aa.php0x0c0x16QUERY_STRINGv
阅读全文
摘要:当后端某机器无法连接,或者处理fastcgi请求时异常退出,nginx会将fastcgi请求发送到另外一台机器。 配置文件 2017/10/11 11:12:21 [debug] 24481#0: *66 http upstream request: "/aa.php?"2017/10/11 11:
阅读全文
摘要:配置 # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { root html; fastcgi_pass 192.168.22.103:9000; fastcgi_ind
阅读全文
摘要:请求NGINX ->[ {(post data) +> (NGX_HTTP_FASTCGI_STDIN)} * N +> {(environment variables) +> (NGX_HTTP_FASTCGI_PARAMS)} * N +> (角色和连接设置) +> (NGX_HTTP_FAST
阅读全文
摘要:[85.36] [5.65] [0.00] [123.11] [58.77] [212.88] [0.02] [0.00] [0.00] [9999.00] [0.02] [5.65] [0.00] [0.00] [58.77] [0.00] [85.36] [212.88] [123.11] [9
阅读全文
摘要:#include #include #include /* typedef unsigned long ngx_atomic_uint_t; typedef volatile ngx_atomic_uint_t ngx_atomic_t; typedef long ngx_atomic_int_t; #defin...
阅读全文
摘要:#include #include #include #include #include #include #include #include #include int main(){ char *pAddr,*cAddr; int shmid; struct shmid_ds shmbuf; //IPC_PRIVATE:创建新的共享内存 //S_IRUSR|S_I...
阅读全文
摘要:#include #include #include #include using namespace std; bool findCondition(int x) { return x%2==0; } //仿函数 template struct display{ void operator()(const T &x)const { cout iv;//vector...
阅读全文
摘要:void foo(int (^blkParam)()){ NSLog(@"foo param %d",blkParam()); } void run() { //定义 返回值类型 (^block的名称)(参数类型) = ^返回值类型(参数) {...}; void (^blk)(void) = ^{ NSLog(@"aaaaa"); }; ...
阅读全文