function after_upstream_callback($info, &$headers, &$body)
{
    $url = $info['url'];
    $path = parse_url($url, PHP_URL_PATH);
    $mta_content = mta_decode($headers, $body);
    $title = 'recv ' . $path . ' ' . keyval_str($mta_content);
    jsondb_logger('nofity', $title, ['url' => $url, 'info' => $info, 'headers' => $headers, 'body' => $body, 'bin2hex' => hex_view($body), 'decode' => $mta_content]);
}
echo html_head($title) . '<body bgcolor="' . $s_cust['color']['area'] . "\">\n" . js_window_resize(BLOB_WINDOW_WIDTH, BLOB_WINDOW_HEIGHT) . '<form method="post" action="' . url_session($_SERVER['PHP_SELF']) . '" name="showblob_form">' . "\n" . hidden_field('table', htmlentities($table)) . hidden_field('col', htmlentities($col)) . hidden_field('where', htmlentities($where)) . "<table>\n<tr>\n<td>\n" . get_selectlist('blobtype', $blob_types, $s_wt['blob_as'][$col], TRUE) . "</td>\n<td>\n" . '<input type="submit" name="change_blobtype" value="Change Type">' . "\n" . "</td>\n<td width=\"50\">\n</td>\n<td>\n" . '<input type="button" value="Close" onClick="self.close()">' . "\n" . "</td>\n</tr>\n<table>\n" . "</form>\n";
$blobas = isset($s_wt['blob_as'][$col]) && $s_wt['blob_as'][$col] != '' ? $s_wt['blob_as'][$col] : 'hex';
switch ($blobas) {
    case 'png':
    case 'jpg':
    case 'gif':
        echo '<img src="' . $imageurl . "\">\n";
        break;
    case 'text':
        echo '<pre align="left">' . htmlspecialchars($blob) . "</pre>\n";
        break;
    case 'html':
        echo $blob;
        break;
    case 'hex':
        echo hex_view($blob);
        break;
}
echo "</body>\n" . "</html>\n";
function hex_view($data)
{
    global $s_cust;
    $len = strlen($data);
    $lines = ceil($len / 16);
    $offset = $values = $ascii = '';
    $p = 0;
    for ($i = 1; $i <= $lines; $i++) {
        $offset .= sprintf('%08x', $p);
        for ($j = 0; $j < 16; $j++) {
            if ($p > $len - 1) {
                break;