Index: src/debug-agent.cc |
diff --git a/src/debug-agent.cc b/src/debug-agent.cc |
index 520bc62926254b54e0e75df50678144bbfb47132..591d0b3e464bd79bb53e01fc947b1741534f8a45 100644 |
--- a/src/debug-agent.cc |
+++ b/src/debug-agent.cc |
@@ -169,7 +169,8 @@ void DebuggerAgentSession::Run() { |
while (true) { |
// Read data from the debugger front end. |
- SmartPointer<char> message = DebuggerAgentUtil::ReceiveMessage(client_); |
+ SmartArrayPointer<char> message = |
+ DebuggerAgentUtil::ReceiveMessage(client_); |
const char* msg = *message; |
bool is_closing_session = (msg == NULL); |
@@ -232,7 +233,7 @@ const int DebuggerAgentUtil::kContentLengthSize = |
StrLength(kContentLength); |
-SmartPointer<char> DebuggerAgentUtil::ReceiveMessage(const Socket* conn) { |
+SmartArrayPointer<char> DebuggerAgentUtil::ReceiveMessage(const Socket* conn) { |
int received; |
// Read header. |
@@ -250,7 +251,7 @@ SmartPointer<char> DebuggerAgentUtil::ReceiveMessage(const Socket* conn) { |
received = conn->Receive(&c, 1); |
if (received <= 0) { |
PrintF("Error %d\n", Socket::LastError()); |
- return SmartPointer<char>(); |
+ return SmartArrayPointer<char>(); |
} |
// Add character to header buffer. |
@@ -287,12 +288,12 @@ SmartPointer<char> DebuggerAgentUtil::ReceiveMessage(const Socket* conn) { |
if (strcmp(key, kContentLength) == 0) { |
// Get the content length value if present and within a sensible range. |
if (value == NULL || strlen(value) > 7) { |
- return SmartPointer<char>(); |
+ return SmartArrayPointer<char>(); |
} |
for (int i = 0; value[i] != '\0'; i++) { |
// Bail out if illegal data. |
if (value[i] < '0' || value[i] > '9') { |
- return SmartPointer<char>(); |
+ return SmartArrayPointer<char>(); |
} |
content_length = 10 * content_length + (value[i] - '0'); |
} |
@@ -304,7 +305,7 @@ SmartPointer<char> DebuggerAgentUtil::ReceiveMessage(const Socket* conn) { |
// Return now if no body. |
if (content_length == 0) { |
- return SmartPointer<char>(); |
+ return SmartArrayPointer<char>(); |
} |
// Read body. |
@@ -312,11 +313,11 @@ SmartPointer<char> DebuggerAgentUtil::ReceiveMessage(const Socket* conn) { |
received = ReceiveAll(conn, buffer, content_length); |
if (received < content_length) { |
PrintF("Error %d\n", Socket::LastError()); |
- return SmartPointer<char>(); |
+ return SmartArrayPointer<char>(); |
} |
buffer[content_length] = '\0'; |
- return SmartPointer<char>(buffer); |
+ return SmartArrayPointer<char>(buffer); |
} |