设为首页 收藏本站
查看: 1145|回复: 0

[经验分享] squid的处理request和reply的流程

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2015-9-3 08:53:33 | 显示全部楼层 |阅读模式
  request处理:



Breakpoint 6, SQUID_MD5Final (
digest=0x764d00 "\021dZcaFe\270\273a\020,\304j\222\347\227\372\364\206%B\245#\203\352\275It\357\266\343\003I\322`\225\250\370\204<k?I\275\353O9", ctx=0x7fff24ec0e80) at md5.c:131
131    {
(gdb) bt
#0  SQUID_MD5Final (
digest=0x764d00 "\021dZcaFe\270\273a\020,\304j\222\347\227\372\364\206%B\245#\203\352\275It\357\266\343\003I\322`\225\250\370\204<k?I\275\353O9", ctx=0x7fff24ec0e80) at md5.c:131
#1  0x0000000000489e35 in storeKeyPublicByRequestMethod (request=0x1d544a0, method=1) at store_key_md5.c:158
#2  0x00000000004809c7 in storeGetPublicByRequestMethod (req=0x1d544a0, method=1) at store.c:371
#3  0x00000000004809f1 in storeGetPublicByRequest (req=0x1d544a0) at store.c:377
#4  0x0000000000428c1b in clientProcessRequest2 (http=0x1d54058) at client_side.c:3387
#5  0x00000000004293aa in clientProcessRequest (http=0x1d54058) at client_side.c:3538
#6  0x000000000042026b in clientCheckNoCacheDone (answer=1, data=0x1d54058) at client_side.c:595
#7  0x000000000040af87 in aclCheckCallback (checklist=0x1d66718, answer=ACCESS_ALLOWED) at acl.c:2297
#8  0x000000000040ad7e in aclCheck (checklist=0x1d66718) at acl.c:2254
#9  0x000000000040b3db in aclNBCheck (checklist=0x1d66718, callback=0x420211 <clientCheckNoCacheDone>,
callback_data=0x1d54058) at acl.c:2450
#10 0x00000000004201e7 in clientCheckNoCache (http=0x1d54058) at client_side.c:583
#11 0x000000000041f8dd in clientAccessCheck2 (data=0x1d54058) at client_side.c:395
#12 0x000000000041fa65 in clientFinishRewriteStuff (http=0x1d54058) at client_side.c:447
#13 0x000000000042f2ac in clientStoreURLRewriteDone (data=0x1d54058, result=0x0) at client_side_storeurl_rewrite.c:216
#14 0x000000000042f0ef in clientStoreURLRewriteStart (http=0x1d54058) at client_side_storeurl_rewrite.c:178
#15 0x000000000042ec44 in clientRedirectDone (data=0x1d54058, result=0x0) at client_side_rewrite.c:482
#16 0x000000000042e45a in clientRedirectAccessCheckDone (answer=0, data=0x1d54058) at client_side_rewrite.c:361
#17 0x000000000040af87 in aclCheckCallback (checklist=0x1d54b98, answer=ACCESS_DENIED) at acl.c:2297
#18 0x000000000040ae1e in aclCheck (checklist=0x1d54b98) at acl.c:2266
#19 0x000000000040b3db in aclNBCheck (checklist=0x1d54b98, callback=0x42e246 <clientRedirectAccessCheckDone>,
---Type <return> to continue, or q <return> to quit---
callback_data=0x1d54058) at acl.c:2450
#20 0x000000000042e51f in clientRedirectStart (http=0x1d54058) at client_side_rewrite.c:374
#21 0x000000000041fbe5 in clientAccessCheckDone (answer=1, data=0x1d54058) at client_side.c:470
#22 0x000000000040af87 in aclCheckCallback (checklist=0x1d54a18, answer=ACCESS_ALLOWED) at acl.c:2297
#23 0x000000000040ad7e in aclCheck (checklist=0x1d54a18) at acl.c:2254
#24 0x000000000040b3db in aclNBCheck (checklist=0x1d54a18, callback=0x41fa67 <clientAccessCheckDone>,
callback_data=0x1d54058) at acl.c:2450
#25 0x000000000041f862 in clientAccessCheck (data=0x1d54058) at client_side.c:384
#26 0x000000000041f80f in clientCheckFollowXForwardedFor (data=0x1d54058) at client_side.c:376
#27 0x000000000042b7aa in clientTryParseRequest (conn=0x1d52d98) at client_side.c:4103
#28 0x000000000042bd75 in clientReadRequest (fd=12, data=0x1d52d98) at client_side.c:4221
#29 0x0000000000432bd9 in comm_call_handlers (fd=12, read_event=1, write_event=0) at comm_generic.c:264
#30 0x00000000004334de in do_comm_select (msec=735) at comm_epoll.c:195
#31 0x0000000000432fc3 in comm_select (msec=735) at comm_generic.c:390
#32 0x0000000000466c9a in main (argc=2, argv=0x7fff24ec1fd8) at main.c:863
  
  



(gdb) bt
#0  SQUID_MD5Final (digest=0x764d20 "", ctx=0x7fff811cd960) at md5.c:131
#1  0x0000000000489c02 in storeKeyPrivate (url=0x1cad320 "http://127.0.0.1:70/hello", method=1, id=1)
at store_key_md5.c:106
#2  0x0000000000480b00 in storeSetPrivateKey (e=0x1cad3e0) at store.c:407
#3  0x000000000048340c in storeCreateEntry (url=0x1cad290 "http://127.0.0.1:70/hello", flags=..., method=1)
at store.c:1097
#4  0x0000000000420b06 in clientProcessExpired (http=0x1c830f8) at client_side.c:751
#5  0x000000000042085b in clientRefreshCheckDone (data=0x1c830f8, fresh=0, log=0x0) at client_side.c:707
#6  0x00000000004765e7 in refreshCheckSubmit (entry=0x1c81d80, callback=0x4207d0 <clientRefreshCheckDone>,
callback_data=0x1c830f8) at refresh_check.c:451
#7  0x00000000004207ce in clientRefreshCheck (http=0x1c830f8) at client_side.c:693
#8  0x00000000004262a9 in clientCacheHit (data=0x1c830f8, rep=0x1cabb10) at client_side.c:2453
#9  0x000000000041f6b0 in storeClientCopyHeadersCB (data=0x1c830f8, buf=0x1c9e1b0 "", size=272) at client_side.c:185
#10 0x0000000000486af5 in storeClientCallback (sc=0x1c9e138, sz=272) at store_client.c:146
#11 0x0000000000487bd2 in storeClientReadHeader (data=0x1c9e138, buf=0x1c9e1b0 "", len=391) at store_client.c:512
#12 0x000000000049c10c in storeUfsReadDone (fd=<value optimized out>, buf=0x1c9e1b0 "", len=<value optimized out>,
errflag=0, my_data=0x1c81308) at ufs/store_io_ufs.c:238
#13 0x0000000000434dec in diskHandleRead (fd=16, data=0x1c81380) at disk.c:380
#14 0x0000000000434ec8 in file_read (fd=16, buf=0x1c9e1b0 "", req_len=4096, file_offset=0,
handler=0x49c050 <storeUfsReadDone>, client_data=0x1c81308) at disk.c:404
#15 0x00000000004865c4 in storeRead (sio=0x1c81308, buf=0x1c9e1b0 "", size=4096, offset=0,
callback=0x48747a <storeClientReadHeader>, callback_data=0x1c9e138) at store_io.c:103
#16 0x00000000004872c6 in storeClientFileRead (sc=0x1c9e138) at store_client.c:338
---Type <return> to continue, or q <return> to quit---
#17 0x0000000000487202 in storeClientCopy3 (e=0x1c81d80, sc=0x1c9e138) at store_client.c:327
#18 0x0000000000486eab in storeClientCopy2 (e=0x1c81d80, sc=0x1c9e138) at store_client.c:249
#19 0x0000000000486ce2 in storeClientCopy (sc=0x1c9e138, e=0x1c81d80, seen_offset=0, copy_offset=0, size=4096,
buf=0x1c9e1b0 "", callback=0x41f5c4 <storeClientCopyHeadersCB>, data=0x1c830f8) at store_client.c:198
#20 0x000000000041f73c in storeClientCopyHeaders (sc=0x1c9e138, e=0x1c81d80, callback=0x425520 <clientCacheHit>,
callback_data=0x1c830f8) at client_side.c:193
#21 0x000000000042953b in clientProcessRequest (http=0x1c830f8) at client_side.c:3556
#22 0x000000000042026b in clientCheckNoCacheDone (answer=1, data=0x1c830f8) at client_side.c:595
#23 0x000000000040af87 in aclCheckCallback (checklist=0x1c95998, answer=ACCESS_ALLOWED) at acl.c:2297
#24 0x000000000040ad7e in aclCheck (checklist=0x1c95998) at acl.c:2254
#25 0x000000000040b3db in aclNBCheck (checklist=0x1c95998, callback=0x420211 <clientCheckNoCacheDone>,
callback_data=0x1c830f8) at acl.c:2450
#26 0x00000000004201e7 in clientCheckNoCache (http=0x1c830f8) at client_side.c:583
#27 0x000000000041f8dd in clientAccessCheck2 (data=0x1c830f8) at client_side.c:395
#28 0x000000000041fa65 in clientFinishRewriteStuff (http=0x1c830f8) at client_side.c:447
#29 0x000000000042f2ac in clientStoreURLRewriteDone (data=0x1c830f8, result=0x0) at client_side_storeurl_rewrite.c:216
#30 0x000000000042f0ef in clientStoreURLRewriteStart (http=0x1c830f8) at client_side_storeurl_rewrite.c:178
#31 0x000000000042ec44 in clientRedirectDone (data=0x1c830f8, result=0x0) at client_side_rewrite.c:482
#32 0x000000000042e45a in clientRedirectAccessCheckDone (answer=0, data=0x1c830f8) at client_side_rewrite.c:361
#33 0x000000000040af87 in aclCheckCallback (checklist=0x1c83d58, answer=ACCESS_DENIED) at acl.c:2297
#34 0x000000000040ae1e in aclCheck (checklist=0x1c83d58) at acl.c:2266
#35 0x000000000040b3db in aclNBCheck (checklist=0x1c83d58, callback=0x42e246 <clientRedirectAccessCheckDone>,
callback_data=0x1c830f8) at acl.c:2450
---Type <return> to continue, or q <return> to quit---
#36 0x000000000042e51f in clientRedirectStart (http=0x1c830f8) at client_side_rewrite.c:374
#37 0x000000000041fbe5 in clientAccessCheckDone (answer=1, data=0x1c830f8) at client_side.c:470
#38 0x000000000040af87 in aclCheckCallback (checklist=0x1c83ba8, answer=ACCESS_ALLOWED) at acl.c:2297
#39 0x000000000040ad7e in aclCheck (checklist=0x1c83ba8) at acl.c:2254
#40 0x000000000040b3db in aclNBCheck (checklist=0x1c83ba8, callback=0x41fa67 <clientAccessCheckDone>,
callback_data=0x1c830f8) at acl.c:2450
#41 0x000000000041f862 in clientAccessCheck (data=0x1c830f8) at client_side.c:384
#42 0x000000000041f80f in clientCheckFollowXForwardedFor (data=0x1c830f8) at client_side.c:376
#43 0x000000000042b7aa in clientTryParseRequest (conn=0x1c81e38) at client_side.c:4103
#44 0x000000000042bd75 in clientReadRequest (fd=12, data=0x1c81e38) at client_side.c:4221
#45 0x0000000000432bd9 in comm_call_handlers (fd=12, read_event=1, write_event=0) at comm_generic.c:264
#46 0x00000000004334de in do_comm_select (msec=998) at comm_epoll.c:195
#47 0x0000000000432fc3 in comm_select (msec=998) at comm_generic.c:390
#48 0x0000000000466c9a in main (argc=2, argv=0x7fff811cf088) at main.c:863
(gdb)
  
  reply报文的处理过程:



(gdb)
#0  SQUID_MD5Final (digest=0x764d20 "\237:\027", ctx=0x7fff811ceb70) at md5.c:131
#1  0x0000000000489c02 in storeKeyPrivate (url=0x1cad2c0 "http://127.0.0.1:70/hello", method=1, id=2)
at store_key_md5.c:106
#2  0x0000000000480b00 in storeSetPrivateKey (e=0x1c81d80) at store.c:407
#3  0x000000000048329e in storeSetPublicKey (e=0x1cad3e0) at store.c:1070
#4  0x000000000044ef4e in httpMakePublic (entry=0x1cad3e0) at http.c:115
#5  0x00000000004500cd in httpProcessReplyHeader (httpState=0x1cada28,
buf=0x70cee0 "HTTP/1.0 200 OK\r\nAge: 3000\r\nCache-control: public,max-age=6000\r\nLast-modified: Mon,09 Jun 2014 06:20:32 GMT\r\nExpire: Mon,16 Jun 2014 06:20:32 GMT\r\nEtag: ", 'x' <repeats 16 times>, "\r\nContent-Type: text; charset=I"..., size=272) at http.c:565
#6  0x00000000004515b6 in httpReadReply (fd=17, data=0x1cada28) at http.c:970
#7  0x0000000000432bd9 in comm_call_handlers (fd=17, read_event=1, write_event=0) at comm_generic.c:264
#8  0x00000000004334de in do_comm_select (msec=983) at comm_epoll.c:195
#9  0x0000000000432fc3 in comm_select (msec=983) at comm_generic.c:390
#10 0x0000000000466c9a in main (argc=2, argv=0x7fff811cf088) at main.c:863
  

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-108900-1-1.html 上篇帖子: Squid--hash代码分析 下篇帖子: Samba 与squid 都可以统一使用域(AD)验证
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表