Closed Bug 613391 Opened 15 years ago Closed 15 years ago

"push" command needs buffering in SUTAgentPython

Categories

(Testing :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mcote, Unassigned)

Details

Attachments

(1 file, 1 obsolete file)

The "push" command doesn't work properly if the commands arrive too quickly to the agent. The handle() method reads up to 1024 bytes, which may include the file data itself. But the push() function reads directly from the socket, so it might miss some of the data. So the data needs to be buffered and read from the buffer first before going back to the socket. There are also a few smaller bugs: - the params aren't counted - need support for new "isdir" command - allow_reuse_addr should be set so that the agent can be restarted quickly.
Attachment #491716 - Flags: review?(jmaher)
Okay this patch is as the previous, but it also implements the new "pull" command that was recently added to the Android agent. I also made the cd command not print out the cwd, since the Android agent doesn't.
Attachment #491716 - Attachment is obsolete: true
Attachment #493047 - Flags: review?(jmaher)
Attachment #491716 - Flags: review?(jmaher)
Attachment #493047 - Flags: review?(jmaher) → review?(ctalbert)
Attachment #493047 - Flags: review?(ctalbert) → review?(jmaher)
Comment on attachment 493047 [details] [diff] [review] Patch for buffering socket data, new pull command, and other small fixes >diff --git a/SUTAgentPython/test-agent.py b/SUTAgentPython/test-agent.py >@@ -155,17 +185,17 @@ class ThreadedTestHandler(SocketServer. >- for part in parts[1+int(num_options):]: >+ for part in parts[1+int(num_options):1+int(num_options)+(num_params)]: we should put int(num_params) to be safe here r+ with that change made.
Attachment #493047 - Flags: review?(jmaher) → review+
Right, good catch. Committed, with that fix.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Component: New Frameworks → General
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: