Esempio n. 1
0
// Write bytes to the already opened SSH connection
int
SSHClient::sshWrite(cygnal::Buffer &buf)
{
    GNASH_REPORT_FUNCTION;

    return sshWrite(buf.reference(), buf.allocated());
}
Esempio n. 2
0
// Read bytes from the already opened SSH connection
int
SSHClient::sshRead(cygnal::Buffer &buf)
{
    GNASH_REPORT_FUNCTION;

    return sshRead(buf.reference(), buf.size());
}
Esempio n. 3
0
int 
SSHClient::writeChannel(ssh_channel channel, cygnal::Buffer &buf)
{
//    GNASH_REPORT_FUNCTION;
    int ret = -1;

    if (channel) {
	ret = channel_write(channel, buf.reference(), buf.size());
    } else {
	log_error(_("Can't write to a non-existent channel!"));
    }

    return ret;
}
Esempio n. 4
0
DiskStream::DiskStream(const string &str, cygnal::Buffer &buf)
    : _state(DiskStream::NO_STATE),
      _filefd(0),
      _netfd(0),
      _dataptr(0),
      _max_memload(0),
      _pagesize(0),
      _offset(0)
{
//    GNASH_REPORT_FUNCTION;
    
    /// \brief get the pagesize and cache the value
#ifdef HAVE_SYSCONF
    _pagesize = sysconf(_SC_PAGESIZE);
    _max_memload = _pagesize * MAX_PAGES;    
#else
#ifdef _WIN32
    SYSTEM_INFO si;
    GetSystemInfo(&si);
    _pagesize = si.dwPageSize;
#else
#ifdef __amigaos4__
    uint32 PageSize;
    
    IExec->GetCPUInfoTags(
	GCIT_ExecPageSize, &PageSize, 
	TAG_DONE);
    _pagesize = PageSize;
#else
#error "Need to define the memory page size without sysconf()!"
#endif
#endif
#endif

    _dataptr = new boost::uint8_t[buf.size()];
    // Note that this is a copy operation, which may effect performance. We do this for now
    // incase the top level pointer gets deleted. This should really be using
    // boost::scoped_array, but we don't want that complexity till this code stabalizes.
    std::copy(buf.begin(), buf.end(), _dataptr);
    _filespec = str;
    _filesize = buf.size();
    
#ifdef USE_STATS_CACHE
    clock_gettime (CLOCK_REALTIME, &_last_access);
    _accesses = 1;
#endif
}
Esempio n. 5
0
boost::shared_ptr<RTMP::rtmp_head_t>
RTMP::decodeHeader(cygnal::Buffer &buf)
{
//    GNASH_REPORT_FUNCTION;
    return decodeHeader(buf.reference());
}
Esempio n. 6
0
std::string
Buffer::hexify (cygnal::Buffer &buf, bool ascii)
{
    return gnash::hexify(buf.reference(), buf.allocated(), ascii);
}
Esempio n. 7
0
bool
DiskStream::writeToDisk(const std::string &filespec, cygnal::Buffer &data)
{
//    GNASH_REPORT_FUNCTION;
    return writeToDisk(filespec, data.reference(), data.allocated());
}
Esempio n. 8
0
File: echo.cpp Progetto: aopui/gnash
std::shared_ptr<cygnal::Buffer>
EchoTest::formatEchoResponse(double num, cygnal::Buffer &data)
{
//    GNASH_REPORT_FUNCTION;
    return formatEchoResponse(num, data.reference(), data.allocated());
}