Lines Matching refs:buf

62 	function dump_and_exit($buf)
64 var_dump($buf);
100 $buf = fread($s, 2048);
103 function user_auth($buf) {
107 if ($buf !== "AUTH TLS\r\n") {
109 dump_and_exit($buf);
124 if (!preg_match('/^PBSZ \d+\r\n$/', $buf = fread($s, 2048))) {
126 dump_and_exit($buf);
130 $buf = fread($s, 2048);
132 if ($buf !== "PROT P\r\n") {
134 dump_and_exit($buf);
139 $buf = fread($s, 2048);
142 if (!preg_match('/^USER (\w+)\r\n$/', $buf, $m)) {
144 dump_and_exit($buf);
159 if (!preg_match('/^PASS (\w+)\r\n$/', $buf = fread($s, 100), $m)) {
161 dump_and_exit($buf);
175 user_auth($buf);
180 while($buf = fread($s, 4098)) {
184 } else if ($buf === "HELP\r\n") {
190 } elseif ($buf === "HELP HELP\r\n") {
193 } elseif ($buf === "PWD\r\n") {
196 } elseif ($buf === "CDUP\r\n") {
200 } elseif ($buf === "SYST\r\n") {
207 } elseif ($buf === "TYPE A\r\n") {
211 } elseif ($buf === "TYPE I\r\n") {
215 } elseif ($buf === "QUIT\r\n") {
218 } elseif (preg_match("~^PORT (\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\r\n$~", $buf, $m)) {
223 } elseif (preg_match("~^STOR ([\w/.-]+)\r\n$~", $buf, $m)) {
262 } elseif (preg_match("~^CWD ([A-Za-z./]+)\r\n$~", $buf, $m)) {
266 } elseif (preg_match("~^NLST(?: ([A-Za-z./]+))?\r\n$~", $buf, $m)) {
293 } elseif (preg_match("~^MKD ([A-Za-z./]+)\r\n$~", $buf, $m)) {
300 } elseif (preg_match('/^USER /', $buf)) {
301 user_auth($buf);
303 } elseif (preg_match('/^MDTM ([\w\h]+)/', $buf, $matches)) {
321 }elseif (preg_match('/^RETR ([\w\h]+)/', $buf, $matches)) {
386 }elseif (preg_match('/^PASV/', $buf, $matches)) {
394 } elseif (preg_match('/^SITE EXEC/', $buf, $matches)) {
397 } elseif (preg_match('/^RMD/', $buf, $matches)) {
400 } elseif (preg_match('/^SITE CHMOD/', $buf, $matches)) {
403 } elseif (preg_match('/^ALLO (\d+)/', $buf, $matches)) {
406 }elseif (preg_match('/^LIST www\//', $buf, $matches)) {
410 }elseif (preg_match('/^LIST no_exists\//', $buf, $matches)) {
413 }elseif (preg_match('/^REST (\d+)/', $buf, $matches)) {
416 }elseif (preg_match('/^SIZE largefile/', $buf)) {
420 dump_and_exit($buf);