Lines Matching refs:buf

63 	function dump_and_exit($buf)
65 var_dump($buf);
101 $buf = fread($s, 2048);
104 function user_auth($buf) {
108 if ($buf !== "AUTH TLS\r\n") {
110 dump_and_exit($buf);
125 if (!preg_match('/^PBSZ \d+\r\n$/', $buf = fread($s, 2048))) {
127 dump_and_exit($buf);
131 $buf = fread($s, 2048);
133 if ($buf !== "PROT P\r\n") {
135 dump_and_exit($buf);
140 $buf = fread($s, 2048);
143 if ($buf == "AUTH TLS\r\n") {
146 } else if (!preg_match('/^USER (\w+)\r\n$/', $buf, $m)) {
148 dump_and_exit($buf);
163 if (!preg_match('/^PASS (\w+)\r\n$/', $buf = fread($s, 100), $m)) {
165 dump_and_exit($buf);
179 user_auth($buf);
184 while($buf = fread($s, 4098)) {
188 } else if ($buf === "HELP\r\n") {
194 } elseif ($buf === "HELP HELP\r\n") {
197 } elseif ($buf === "PWD\r\n") {
200 } elseif ($buf === "CDUP\r\n") {
204 } elseif ($buf === "SYST\r\n") {
211 } elseif ($buf === "TYPE A\r\n") {
215 } elseif ($buf === "AUTH SSL\r\n") {
219 } elseif ($buf === "TYPE I\r\n") {
223 } elseif ($buf === "QUIT\r\n") {
226 } elseif (preg_match("~^PORT (\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\r\n$~", $buf, $m)) {
231 } elseif (preg_match("~^STOR ([\w/.-]+)\r\n$~", $buf, $m)) {
270 } elseif (preg_match("~^CWD ([A-Za-z./]+)\r\n$~", $buf, $m)) {
274 } elseif (preg_match("~^NLST(?: ([A-Za-z./]+))?\r\n$~", $buf, $m)) {
310 } elseif (preg_match("~^MKD ([A-Za-z./]+)\r\n$~", $buf, $m)) {
317 } elseif (preg_match('/^USER /', $buf)) {
318 user_auth($buf);
320 } elseif (preg_match('/^MDTM ([\w\h]+)/', $buf, $matches)) {
338 }elseif (preg_match('/^RETR ([\/]*[\w\h]+)/', $buf, $matches)) {
407 }elseif (preg_match('/^PASV/', $buf, $matches)) {
442 } elseif (preg_match('/^EPSV/', $buf, $matches)) {
444 } elseif (preg_match('/^SITE EXEC/', $buf, $matches)) {
447 } elseif (preg_match('/^RMD/', $buf, $matches)) {
450 } elseif (preg_match('/^SITE CHMOD/', $buf, $matches)) {
453 } elseif (preg_match('/^ALLO (\d+)/', $buf, $matches)) {
456 }elseif (preg_match('/^LIST www\//', $buf, $matches)) {
460 }elseif (preg_match('/^LIST no_exists\//', $buf, $matches)) {
463 }elseif (preg_match('/^REST (\d+)/', $buf, $matches)) {
466 }elseif (preg_match('/^SIZE largefile/', $buf)) {
468 }elseif (preg_match('/^SIZE \/bug73457/', $buf)) {
472 dump_and_exit($buf);