SlideShare ist ein Scribd-Unternehmen logo
1 von 40
Blank Slide
This one too
One for the road
Anatomy of a PHP
    Request
             Joseph Scott
              7 Oct 2010
                 UTOSC
Rules of Engagement
Lifespan
.php



Read   Parse   Compile   Execute   Output
Lifespan
.php



Read   Parse    Compile   Execute   Output


       Apache      /      mod_php
Lifespan
.php



Read   Parse   Compile   Execute   Output


               FastCGI


                Nginx
Reading
Open    Read     Close
Reading
Open            Read        Close


   Avoid   co$tly services like NFS
Parse
 hello.php

         <?php
         echo "Hello, World!n"


Parse error: syntax error, unexpected $end,
expecting ',' or ';' in /tmp/hello.php on line 3
Tokens
              <?php echo
$tokens = token_get_all( '

  "Hello, World!";' );
foreach ( $tokens as $token ) {
    if ( is_array( $token ) ) {
        echo token_name( $token[0] ) . " ( {$token[2]} ) -
    {$token[1]}n";
    } else {
        echo "{$token}n";
    }
}
Tokens

T_OPEN_TAG ( 1 ) - <?php
T_ECHO ( 1 ) - echo
T_WHITESPACE ( 1 ) -
T_CONSTANT_ENCAPSED_STRING ( 1 ) - "Hello,
  World!"
;
Compile
Branch analysis from position: 0
Return found
filename:     /tmp/hello.php
function name: (null)
number of ops: 3
compiled vars: none
line # op                              fetch         ext return operands
-------------------------------------------------------------------------------
   2 0 ECHO                                                       'Hello%2C+World%21%0A'
   3 1 RETURN                                                      1
        2* ZEND_HANDLE_EXCEPTION
Execute
Deceptively Simple Term

•Includes all sorts of activity
•Database / remote requests
Output
•PHP can buffer output
•Don’t forget about compression
Making Things Faster
Making Things Faster

Less work, for the same result =
           awesome
Making Things Faster
.php



Read   Parse   Compile   Execute   Output
Making Things Faster
.php



Read   APC
       Parse   Compile   Execute   Output
Making Things Faster
.php



Read   APC
       Parse   Compile   Execute   Output




        opcode cache
HipHop for PHP
• Open source code translator from Facebook
• Converts PHP into c++
• Single binary with built in web server
• http://github.com/facebook/hiphop-php/
HipHop for PHP

 How much faster?
HipHop for PHP

 How much faster?

Depends (of course)
Measuring Tape for
  Programmers
Measuring Tape for
      Programmers
Xdebug can provide TONS of information

           http://xdebug.org/
Xdebug Profiler
•Generates cachegrind output
 ➡KCachegrind
 ➡webgrind
 ➡MacCallGrind
 ➡WinCacheGrind
 ➡Valgrind
Kcachegrind
webgrind
XHProf
XHProf Call Graph
XHProf Diff
The PHP Point of View
      opcodes

VLD - Vulcan Logic Dumper
Example PHP

$html = file_get_contents( 'http://www.google.com/' );
$regex_pattern = '!<a href="[^>]*">(.*?)</a>!';
preg_match_all( $regex_pattern, $html, $matches );
Example PHP - VLD
Branch analysis from position: 0
Return found
filename:     /drive/home/joseph/vld/parse-links.php
function name: (null)
number of ops: 17
compiled vars: !0 = $html, !1 = $regex_pattern, !2 =
$matches
Example PHP - VLD
line # op                              fetch         ext return operands
-------------------------------------------------------------------------------
   4 0 EXT_STMT
        1 EXT_FCALL_BEGIN
        2 SEND_VAL                                                  'http%3A%2F%2Fwww.google.com%2F'
        3 DO_FCALL                                         1           'file_get_contents'
        4 EXT_FCALL_END
        5 ASSIGN                                                 !0, $0
   5 6 EXT_STMT
        7 ASSIGN                                                 !1, '%21%3Ca+href%3D%22%5B%5E%3E
%5D%2A%22%3E%28.%2A%3F%29%3C%2Fa%3E%21'
   6 8 EXT_STMT
        9 EXT_FCALL_BEGIN
       10 SEND_VAR                                                    !1
       11 SEND_VAR                                                    !0
       12 SEND_REF                                                   !2
       13 DO_FCALL                                          3           'preg_match_all'
       14 EXT_FCALL_END
   7 15 RETURN                                                      1
       16* ZEND_HANDLE_EXCEPTION
PHP - strace

• System calls, expect LOTS of data
• strace -o out php parse-links.php
PHP - strace

• System calls, expect LOTS of data
• strace -o out php parse-links.php

       1,500+ lines of output!
1.
                          PHP - strace
   socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
2. fcntl64(3, F_GETFL) = 0x2 (flags O_RDWR)
3. fcntl64(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
4. connect(3, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("64.233.169.99")}, 16) =
   -1 EINPROGRESS (Operation now in progress)
5. poll([{fd=3, events=POLLIN|POLLOUT|POLLERR|POLLHUP}], 1, 60000) = 1 ([{fd=3,
   revents=POLLOUT}])
6. getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
7. fcntl64(3, F_SETFL, O_RDWR) = 0
8. send(3, "GET / HTTP/1.0rn", 16, MSG_DONTWAIT) = 16
9. send(3, "Host: www.google.comrn", 22, MSG_DONTWAIT) = 22
10.send(3, "rn", 2, MSG_DONTWAIT) = 2
11.poll([{fd=3, events=POLLIN|POLLPRI|POLLERR|POLLHUP}], 1, 0) = 0 (Timeout)
12.poll([{fd=3, events=POLLIN|POLLERR|POLLHUP}], 1, 60000) = 1 ([{fd=3, revents=POLLIN}])
13.recv(3, "HTTP/1.0 200 OKrnDate: Tue, 13 A"..., 8192, MSG_DONTWAIT) = 4636
14.poll([{fd=3, events=POLLIN|POLLERR|POLLHUP}], 1, 60000) = 1 ([{fd=3, revents=POLLIN}])
15.recv(3, "is) class=gb2>Blogs</a> <div cla"..., 8192, MSG_DONTWAIT) = 4290
16.poll([{fd=3, events=POLLIN|POLLERR|POLLHUP}], 1, 60000) = 1 ([{fd=3, revents=POLLIN}])
17.recv(3, "", 8192, MSG_DONTWAIT) = 0
18.poll([{fd=3, events=POLLIN|POLLERR|POLLHUP}], 1, 60000) = 1 ([{fd=3, revents=POLLIN}])
19.recv(3, "", 8192, MSG_DONTWAIT) = 0
20.close(3) = 0
Live Demo Time

Weitere ähnliche Inhalte

Was ist angesagt?

Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門
lestrrat
 
Smolder @Silex
Smolder @SilexSmolder @Silex
Smolder @Silex
Jeen Lee
 
Phpをいじり倒す10の方法
Phpをいじり倒す10の方法Phpをいじり倒す10の方法
Phpをいじり倒す10の方法
Moriyoshi Koizumi
 

Was ist angesagt? (20)

The why and how of moving to php 5.4/5.5
The why and how of moving to php 5.4/5.5The why and how of moving to php 5.4/5.5
The why and how of moving to php 5.4/5.5
 
Perl IO
Perl IOPerl IO
Perl IO
 
Debugging: Rules & Tools
Debugging: Rules & ToolsDebugging: Rules & Tools
Debugging: Rules & Tools
 
An introduction to PHP 5.4
An introduction to PHP 5.4An introduction to PHP 5.4
An introduction to PHP 5.4
 
2016年のPerl (Long version)
2016年のPerl (Long version)2016年のPerl (Long version)
2016年のPerl (Long version)
 
Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)
 
Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門
 
Smolder @Silex
Smolder @SilexSmolder @Silex
Smolder @Silex
 
Publishing a Perl6 Module
Publishing a Perl6 ModulePublishing a Perl6 Module
Publishing a Perl6 Module
 
Hachiojipm11
Hachiojipm11Hachiojipm11
Hachiojipm11
 
Quick tour of PHP from inside
Quick tour of PHP from insideQuick tour of PHP from inside
Quick tour of PHP from inside
 
The new features of PHP 7
The new features of PHP 7The new features of PHP 7
The new features of PHP 7
 
Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2
 
Working with databases in Perl
Working with databases in PerlWorking with databases in Perl
Working with databases in Perl
 
Phpをいじり倒す10の方法
Phpをいじり倒す10の方法Phpをいじり倒す10の方法
Phpをいじり倒す10の方法
 
On UnQLite
On UnQLiteOn UnQLite
On UnQLite
 
Better detection of what modules are used by some Perl 5 code
Better detection of what modules are used by some Perl 5 codeBetter detection of what modules are used by some Perl 5 code
Better detection of what modules are used by some Perl 5 code
 
Zend con 2016 - Asynchronous Prorgamming in PHP
Zend con 2016 - Asynchronous Prorgamming in PHPZend con 2016 - Asynchronous Prorgamming in PHP
Zend con 2016 - Asynchronous Prorgamming in PHP
 
Vladimir Vorontsov - Splitting, smuggling and cache poisoning come back
Vladimir Vorontsov - Splitting, smuggling and cache poisoning come backVladimir Vorontsov - Splitting, smuggling and cache poisoning come back
Vladimir Vorontsov - Splitting, smuggling and cache poisoning come back
 
Is your code ready for PHP 7 ?
Is your code ready for PHP 7 ?Is your code ready for PHP 7 ?
Is your code ready for PHP 7 ?
 

Ähnlich wie Anatomy of a PHP Request ( UTOSC 2010 )

Security in PHP - 那些在滲透測試的小技巧
Security in PHP - 那些在滲透測試的小技巧Security in PHP - 那些在滲透測試的小技巧
Security in PHP - 那些在滲透測試的小技巧
Orange Tsai
 
Orange@php conf
Orange@php confOrange@php conf
Orange@php conf
Hash Lin
 
Tips
TipsTips
Tips
mclee
 
GettingStartedWithPHP
GettingStartedWithPHPGettingStartedWithPHP
GettingStartedWithPHP
Nat Weerawan
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to Ferrari
Joseph Scott
 

Ähnlich wie Anatomy of a PHP Request ( UTOSC 2010 ) (20)

Debugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 VersionDebugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 Version
 
第1回PHP拡張勉強会
第1回PHP拡張勉強会第1回PHP拡張勉強会
第1回PHP拡張勉強会
 
Living With Legacy Code
Living With Legacy CodeLiving With Legacy Code
Living With Legacy Code
 
Security in PHP - 那些在滲透測試的小技巧
Security in PHP - 那些在滲透測試的小技巧Security in PHP - 那些在滲透測試的小技巧
Security in PHP - 那些在滲透測試的小技巧
 
Orange@php conf
Orange@php confOrange@php conf
Orange@php conf
 
Tips
TipsTips
Tips
 
PHP5.5 is Here
PHP5.5 is HerePHP5.5 is Here
PHP5.5 is Here
 
GettingStartedWithPHP
GettingStartedWithPHPGettingStartedWithPHP
GettingStartedWithPHP
 
Php101
Php101Php101
Php101
 
DevOps in PHP environment
DevOps in PHP environmentDevOps in PHP environment
DevOps in PHP environment
 
The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016
The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016
The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016
 
PHP & Performance
PHP & PerformancePHP & Performance
PHP & Performance
 
What's new with PHP7
What's new with PHP7What's new with PHP7
What's new with PHP7
 
php & performance
 php & performance php & performance
php & performance
 
Prepare for PHP Test Fest 2009
Prepare for PHP Test Fest 2009Prepare for PHP Test Fest 2009
Prepare for PHP Test Fest 2009
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to Ferrari
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
 
Php 7 evolution
Php 7 evolutionPhp 7 evolution
Php 7 evolution
 
Wt unit 4 server side technology-2
Wt unit 4 server side technology-2Wt unit 4 server side technology-2
Wt unit 4 server side technology-2
 
Revoke-Obfuscation
Revoke-ObfuscationRevoke-Obfuscation
Revoke-Obfuscation
 

Mehr von Joseph Scott

Mehr von Joseph Scott (8)

Scaling WordPress
Scaling WordPressScaling WordPress
Scaling WordPress
 
Site Testing with CasperJS
Site Testing with CasperJSSite Testing with CasperJS
Site Testing with CasperJS
 
Python & FUSE
Python & FUSEPython & FUSE
Python & FUSE
 
Improving Front End Performance
Improving Front End PerformanceImproving Front End Performance
Improving Front End Performance
 
WordPress Performance & Scalability
WordPress Performance & ScalabilityWordPress Performance & Scalability
WordPress Performance & Scalability
 
WordPress APIs
WordPress APIsWordPress APIs
WordPress APIs
 
WordPress Performance & Scalability
WordPress Performance & ScalabilityWordPress Performance & Scalability
WordPress Performance & Scalability
 
WordPress APIs
WordPress APIsWordPress APIs
WordPress APIs
 

Kürzlich hochgeladen

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Kürzlich hochgeladen (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

Anatomy of a PHP Request ( UTOSC 2010 )

  • 3. One for the road
  • 4. Anatomy of a PHP Request Joseph Scott 7 Oct 2010 UTOSC
  • 6. Lifespan .php Read Parse Compile Execute Output
  • 7. Lifespan .php Read Parse Compile Execute Output Apache / mod_php
  • 8. Lifespan .php Read Parse Compile Execute Output FastCGI Nginx
  • 9. Reading Open Read Close
  • 10. Reading Open Read Close Avoid co$tly services like NFS
  • 11. Parse hello.php <?php echo "Hello, World!n" Parse error: syntax error, unexpected $end, expecting ',' or ';' in /tmp/hello.php on line 3
  • 12. Tokens <?php echo $tokens = token_get_all( ' "Hello, World!";' ); foreach ( $tokens as $token ) {     if ( is_array( $token ) ) {         echo token_name( $token[0] ) . " ( {$token[2]} ) - {$token[1]}n";     } else {         echo "{$token}n";     } }
  • 13. Tokens T_OPEN_TAG ( 1 ) - <?php T_ECHO ( 1 ) - echo T_WHITESPACE ( 1 ) - T_CONSTANT_ENCAPSED_STRING ( 1 ) - "Hello, World!" ;
  • 14. Compile Branch analysis from position: 0 Return found filename: /tmp/hello.php function name: (null) number of ops: 3 compiled vars: none line # op fetch ext return operands ------------------------------------------------------------------------------- 2 0 ECHO 'Hello%2C+World%21%0A' 3 1 RETURN 1 2* ZEND_HANDLE_EXCEPTION
  • 15. Execute Deceptively Simple Term •Includes all sorts of activity •Database / remote requests
  • 16. Output •PHP can buffer output •Don’t forget about compression
  • 18. Making Things Faster Less work, for the same result = awesome
  • 19. Making Things Faster .php Read Parse Compile Execute Output
  • 20. Making Things Faster .php Read APC Parse Compile Execute Output
  • 21. Making Things Faster .php Read APC Parse Compile Execute Output opcode cache
  • 22. HipHop for PHP • Open source code translator from Facebook • Converts PHP into c++ • Single binary with built in web server • http://github.com/facebook/hiphop-php/
  • 23. HipHop for PHP How much faster?
  • 24. HipHop for PHP How much faster? Depends (of course)
  • 25. Measuring Tape for Programmers
  • 26. Measuring Tape for Programmers Xdebug can provide TONS of information http://xdebug.org/
  • 27. Xdebug Profiler •Generates cachegrind output ➡KCachegrind ➡webgrind ➡MacCallGrind ➡WinCacheGrind ➡Valgrind
  • 33. The PHP Point of View opcodes VLD - Vulcan Logic Dumper
  • 34. Example PHP $html = file_get_contents( 'http://www.google.com/' ); $regex_pattern = '!<a href="[^>]*">(.*?)</a>!'; preg_match_all( $regex_pattern, $html, $matches );
  • 35. Example PHP - VLD Branch analysis from position: 0 Return found filename: /drive/home/joseph/vld/parse-links.php function name: (null) number of ops: 17 compiled vars: !0 = $html, !1 = $regex_pattern, !2 = $matches
  • 36. Example PHP - VLD line # op fetch ext return operands ------------------------------------------------------------------------------- 4 0 EXT_STMT 1 EXT_FCALL_BEGIN 2 SEND_VAL 'http%3A%2F%2Fwww.google.com%2F' 3 DO_FCALL 1 'file_get_contents' 4 EXT_FCALL_END 5 ASSIGN !0, $0 5 6 EXT_STMT 7 ASSIGN !1, '%21%3Ca+href%3D%22%5B%5E%3E %5D%2A%22%3E%28.%2A%3F%29%3C%2Fa%3E%21' 6 8 EXT_STMT 9 EXT_FCALL_BEGIN 10 SEND_VAR !1 11 SEND_VAR !0 12 SEND_REF !2 13 DO_FCALL 3 'preg_match_all' 14 EXT_FCALL_END 7 15 RETURN 1 16* ZEND_HANDLE_EXCEPTION
  • 37. PHP - strace • System calls, expect LOTS of data • strace -o out php parse-links.php
  • 38. PHP - strace • System calls, expect LOTS of data • strace -o out php parse-links.php 1,500+ lines of output!
  • 39. 1. PHP - strace socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3 2. fcntl64(3, F_GETFL) = 0x2 (flags O_RDWR) 3. fcntl64(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0 4. connect(3, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("64.233.169.99")}, 16) = -1 EINPROGRESS (Operation now in progress) 5. poll([{fd=3, events=POLLIN|POLLOUT|POLLERR|POLLHUP}], 1, 60000) = 1 ([{fd=3, revents=POLLOUT}]) 6. getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0 7. fcntl64(3, F_SETFL, O_RDWR) = 0 8. send(3, "GET / HTTP/1.0rn", 16, MSG_DONTWAIT) = 16 9. send(3, "Host: www.google.comrn", 22, MSG_DONTWAIT) = 22 10.send(3, "rn", 2, MSG_DONTWAIT) = 2 11.poll([{fd=3, events=POLLIN|POLLPRI|POLLERR|POLLHUP}], 1, 0) = 0 (Timeout) 12.poll([{fd=3, events=POLLIN|POLLERR|POLLHUP}], 1, 60000) = 1 ([{fd=3, revents=POLLIN}]) 13.recv(3, "HTTP/1.0 200 OKrnDate: Tue, 13 A"..., 8192, MSG_DONTWAIT) = 4636 14.poll([{fd=3, events=POLLIN|POLLERR|POLLHUP}], 1, 60000) = 1 ([{fd=3, revents=POLLIN}]) 15.recv(3, "is) class=gb2>Blogs</a> <div cla"..., 8192, MSG_DONTWAIT) = 4290 16.poll([{fd=3, events=POLLIN|POLLERR|POLLHUP}], 1, 60000) = 1 ([{fd=3, revents=POLLIN}]) 17.recv(3, "", 8192, MSG_DONTWAIT) = 0 18.poll([{fd=3, events=POLLIN|POLLERR|POLLHUP}], 1, 60000) = 1 ([{fd=3, revents=POLLIN}]) 19.recv(3, "", 8192, MSG_DONTWAIT) = 0 20.close(3) = 0

Hinweis der Redaktion