parent
389308dfd8
commit
418a04f49d
|
@ -158,12 +158,13 @@ template<>
|
||||||
String read<String>(int socket)
|
String read<String>(int socket)
|
||||||
{
|
{
|
||||||
ByteCount length = read<ByteCount>(socket);
|
ByteCount length = read<ByteCount>(socket);
|
||||||
if (length == 0)
|
String res;
|
||||||
return String{};
|
if (length > 0)
|
||||||
char buffer[2048];
|
{
|
||||||
kak_assert(length < 2048);
|
res.resize((int)length);
|
||||||
read(socket, buffer, (int)length);
|
read(socket, &res[0], (int)length);
|
||||||
return String(buffer, buffer+(int)length);
|
}
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user